check_replace_refs: rename to read_replace_refs
authorJeff King <peff@peff.net>
Wed, 18 Jul 2018 20:45:20 +0000 (16:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Jul 2018 22:45:14 +0000 (15:45 -0700)
This was added as a NEEDSWORK in c3c36d7de2 (replace-object:
check_replace_refs is safe in multi repo environment, 2018-04-11),
waiting for a calmer period. Since doing so now doesn't conflict
with anything in 'pu', it seems as good a time as any.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 files changed:
builtin/fsck.c
builtin/index-pack.c
builtin/pack-objects.c
builtin/prune.c
builtin/replace.c
builtin/unpack-objects.c
builtin/upload-pack.c
cache.h
environment.c
git.c
log-tree.c
replace-object.c
replace-object.h
index 3ad4f160f9959a30262c81d5c3f85c36649d2895..0c3cbb86fc29397cc2b7bc79a47363b9acf3a240 100644 (file)
@@ -689,7 +689,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
        fetch_if_missing = 0;
 
        errors_found = 0;
-       check_replace_refs = 0;
+       read_replace_refs = 0;
 
        argc = parse_options(argc, argv, prefix, fsck_opts, fsck_usage, 0);
 
index 74fe2973e1256e092652fce28ba2036cc3203af9..a24faa0e511cbe2790c6dd1add3d57d62f5558fe 100644 (file)
@@ -1679,7 +1679,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage(index_pack_usage);
 
-       check_replace_refs = 0;
+       read_replace_refs = 0;
        fsck_options.walk = mark_link;
 
        reset_pack_idx_option(&opts);
index ebc8cefb53f4a1fde99eff8d6f19c8df0cec0ede..14235b0ac22145b40f0d96282eb89e2767691d8f 100644 (file)
@@ -3188,7 +3188,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        if (DFS_NUM_STATES > (1 << OE_DFS_STATE_BITS))
                BUG("too many dfs states, increase OE_DFS_STATE_BITS");
 
-       check_replace_refs = 0;
+       read_replace_refs = 0;
 
        reset_pack_idx_option(&pack_idx_opts);
        git_config(git_pack_config, NULL);
index 70ec35aa0582386d233b4d49d4bbdbb9cef985cb..89f9d8155a6d233b199c75579ab3d2b274bfaeea 100644 (file)
@@ -118,7 +118,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
 
        expire = TIME_MAX;
        save_commit_buffer = 0;
-       check_replace_refs = 0;
+       read_replace_refs = 0;
        ref_paranoia = 1;
        init_revisions(&revs, prefix);
 
index deabda210127087188117e394e453373fa48991f..18609c6a8d2bade96fc418a27e48d13cb24586a8 100644 (file)
@@ -544,7 +544,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       check_replace_refs = 0;
+       read_replace_refs = 0;
        git_config(git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
index cf585fcc5eee5e41aac066a08d6db080f33011b8..665fa899f41a53319836240f7d4f3c82a9f213b4 100644 (file)
@@ -513,7 +513,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
        int i;
        struct object_id oid;
 
-       check_replace_refs = 0;
+       read_replace_refs = 0;
 
        git_config(git_default_config, NULL);
 
index decde5a3b1b70442e1550027359dab11f4704468..42dc4da5a1fc047baa9f71288670c3b981cb3b7e 100644 (file)
@@ -31,7 +31,7 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
        };
 
        packet_trace_identity("upload-pack");
-       check_replace_refs = 0;
+       read_replace_refs = 0;
 
        argc = parse_options(argc, argv, NULL, options, upload_pack_usage, 0);
 
diff --git a/cache.h b/cache.h
index 7b09b09cb02a18a42a1be3bd044c6ca4db341db5..3880b6a98bb7c7323385b2d8972416dae326b9ef 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -806,7 +806,7 @@ void reset_shared_repository(void);
  * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
  * commands that do not want replace references to be active.
  */
-extern int check_replace_refs;
+extern int read_replace_refs;
 extern char *git_replace_ref_base;
 
 extern int fsync_object_files;
index 013e845235ea88e977c3181258b3e77e6ecb4c2f..3042e5f40f2679b1d7b59cf80bc191752e2a71b9 100644 (file)
@@ -51,7 +51,7 @@ const char *editor_program;
 const char *askpass_program;
 const char *excludes_file;
 enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
-int check_replace_refs = 1; /* NEEDSWORK: rename to read_replace_refs */
+int read_replace_refs = 1;
 char *git_replace_ref_base;
 enum eol core_eol = EOL_UNSET;
 int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
@@ -183,7 +183,7 @@ void setup_git_env(const char *git_dir)
        argv_array_clear(&to_free);
 
        if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
-               check_replace_refs = 0;
+               read_replace_refs = 0;
        replace_ref_base = getenv(GIT_REPLACE_REF_BASE_ENVIRONMENT);
        free(git_replace_ref_base);
        git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base
diff --git a/git.c b/git.c
index 3fded745195a603d15da399823e060bb75fb26ef..f4e04a82c929be6bd27982444d20072ed3fc3919 100644 (file)
--- a/git.c
+++ b/git.c
@@ -164,7 +164,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                        if (envchanged)
                                *envchanged = 1;
                } else if (!strcmp(cmd, "--no-replace-objects")) {
-                       check_replace_refs = 0;
+                       read_replace_refs = 0;
                        setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
                        if (envchanged)
                                *envchanged = 1;
index 4a3907fea02d50e1074ca1b785780a0753e77468..ec3a689c6adef891f1dec427c95fb3fdbd1483a2 100644 (file)
@@ -91,7 +91,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
 
        if (starts_with(refname, git_replace_ref_base)) {
                struct object_id original_oid;
-               if (!check_replace_refs)
+               if (!read_replace_refs)
                        return 0;
                if (get_oid_hex(refname + strlen(git_replace_ref_base),
                                &original_oid)) {
index 801b5c16789f5ac7d87a4409d8218311a52db0aa..4162df6324a8ec76a2704245db4a2d707179d9d7 100644 (file)
@@ -51,7 +51,7 @@ static void prepare_replace_object(struct repository *r)
  * replacement object's name (replaced recursively, if necessary).
  * The return value is either oid or a pointer to a
  * permanently-allocated value.  This function always respects replace
- * references, regardless of the value of check_replace_refs.
+ * references, regardless of the value of read_replace_refs.
  */
 const struct object_id *do_lookup_replace_object(struct repository *r,
                                                 const struct object_id *oid)
index f996de3d62c6aaa9d30792e5347613ff1f63fbe0..9345e105ddcaa38cf9e856df70d960245a3b696c 100644 (file)
@@ -26,7 +26,7 @@ extern const struct object_id *do_lookup_replace_object(struct repository *r,
 static inline const struct object_id *lookup_replace_object(struct repository *r,
                                                            const struct object_id *oid)
 {
-       if (!check_replace_refs ||
+       if (!read_replace_refs ||
            (r->objects->replace_map &&
             r->objects->replace_map->map.tablesize == 0))
                return oid;