]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: drop USE_THE_REPOSITORY_VARIABLE
authorPatrick Steinhardt <ps@pks.im>
Thu, 11 Jun 2026 06:44:45 +0000 (08:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Jun 2026 12:05:54 +0000 (05:05 -0700)
Adapt a couple of trivial callers of `is_bare_repository()` to instead
use a repository available via the caller's context so that we can drop
the `USE_THE_REPOSITORY_VARIABLE` macro.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c
mailmap.c
refs/reftable-backend.c
setup.c

index bbc6f51639d89c47ad0143e00d50a26db1a86332..d0465fb4f562e237912661927ca1385e362e549d 100644 (file)
@@ -1,4 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
@@ -265,7 +264,7 @@ int cmd_repack(int argc,
 
        if (write_bitmaps < 0) {
                if (write_midx == REPACK_WRITE_MIDX_NONE &&
-                   (!(pack_everything & ALL_INTO_ONE) || !is_bare_repository(the_repository)))
+                   (!(pack_everything & ALL_INTO_ONE) || !is_bare_repository(repo)))
                        write_bitmaps = 0;
        }
        if (po_args.pack_kept_objects < 0)
index 7d8590cdd613fb673e8d5eab53c038f872fa91ce..2d5514f833398bedda65e514b0186166269df51f 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
 #include "git-compat-util.h"
 #include "environment.h"
 #include "string-list.h"
@@ -219,10 +217,10 @@ int read_mailmap(struct repository *repo, struct string_list *map)
        map->strdup_strings = 1;
        map->cmp = namemap_cmp;
 
-       if (!mailmap_blob && is_bare_repository(the_repository))
+       if (!mailmap_blob && is_bare_repository(repo))
                mailmap_blob = xstrdup("HEAD:.mailmap");
 
-       if (!startup_info->have_repository || !is_bare_repository(the_repository))
+       if (!startup_info->have_repository || !is_bare_repository(repo))
                err |= read_mailmap_file(map, ".mailmap",
                                         startup_info->have_repository ?
                                         MAILMAP_NOFOLLOW : 0);
index 101ef29ac868d54a3bf0949128f03a045746c628..c151d331e758366d663dc4f9fab61d6beeb14935 100644 (file)
@@ -1,5 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
-
 #include "../git-compat-util.h"
 #include "../abspath.h"
 #include "../chdir-notify.h"
@@ -288,7 +286,7 @@ static int should_write_log(struct reftable_ref_store *refs, const char *refname
 {
        enum log_refs_config log_refs_cfg = refs->log_all_ref_updates;
        if (log_refs_cfg == LOG_REFS_UNSET)
-               log_refs_cfg = is_bare_repository(the_repository) ? LOG_REFS_NONE : LOG_REFS_NORMAL;
+               log_refs_cfg = is_bare_repository(refs->base.repo) ? LOG_REFS_NONE : LOG_REFS_NORMAL;
 
        switch (log_refs_cfg) {
        case LOG_REFS_NONE:
diff --git a/setup.c b/setup.c
index e6db80ab0728e65bcae64dc2b5dcafd2e72a5e2b..65f4ac95a8dd8c1e534fa8094e36819965c827ef 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1,4 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
@@ -2610,7 +2609,7 @@ static int create_default_files(struct repository *repo,
        }
        repo_config_set(repo, "core.filemode", filemode ? "true" : "false");
 
-       if (is_bare_repository(the_repository))
+       if (is_bare_repository(repo))
                repo_config_set(repo, "core.bare", "true");
        else {
                repo_config_set(repo, "core.bare", "false");