check_replace_refs: rename to read_replace_refs
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>
Jeff King committed
Jul 18, 2018 at 16:45 UTC
6ebd1cafe2bb1dee34e106a8da3ee173b36259d3
13 files changed
+14
-14
builtin/fsck.c
+1
-1
@@ -689,7 +689,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
689
fetch_if_missing = 0;
690
691
errors_found = 0;
692
- check_replace_refs = 0;
692
+ read_replace_refs = 0;
693
694
argc = parse_options(argc, argv, prefix, fsck_opts, fsck_usage, 0);
695
builtin/index-pack.c
+1
-1
@@ -1679,7 +1679,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
1679
if (argc == 2 && !strcmp(argv[1], "-h"))
1680
usage(index_pack_usage);
1681
1682
- check_replace_refs = 0;
1682
+ read_replace_refs = 0;
1683
fsck_options.walk = mark_link;
1684
1685
reset_pack_idx_option(&opts);
builtin/pack-objects.c
+1
-1
@@ -3188,7 +3188,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
3188
if (DFS_NUM_STATES > (1 << OE_DFS_STATE_BITS))
3189
BUG("too many dfs states, increase OE_DFS_STATE_BITS");
3190
3191
- check_replace_refs = 0;
3191
+ read_replace_refs = 0;
3192
3193
reset_pack_idx_option(&pack_idx_opts);
3194
git_config(git_pack_config, NULL);
builtin/prune.c
+1
-1
@@ -118,7 +118,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
118
119
expire = TIME_MAX;
120
save_commit_buffer = 0;
121
- check_replace_refs = 0;
121
+ read_replace_refs = 0;
122
ref_paranoia = 1;
123
init_revisions(&revs, prefix);
124
builtin/replace.c
+1
-1
@@ -544,7 +544,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
544
OPT_END()
545
};
546
547
- check_replace_refs = 0;
547
+ read_replace_refs = 0;
548
git_config(git_default_config, NULL);
549
550
argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
builtin/unpack-objects.c
+1
-1
@@ -513,7 +513,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
513
int i;
514
struct object_id oid;
515
516
- check_replace_refs = 0;
516
+ read_replace_refs = 0;
517
518
git_config(git_default_config, NULL);
519
builtin/upload-pack.c
+1
-1
@@ -31,7 +31,7 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
31
};
32
33
packet_trace_identity("upload-pack");
34
- check_replace_refs = 0;
34
+ read_replace_refs = 0;
35
36
argc = parse_options(argc, argv, NULL, options, upload_pack_usage, 0);
37
cache.h
+1
-1
@@ -806,7 +806,7 @@ void reset_shared_repository(void);
806
* $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
807
* commands that do not want replace references to be active.
808
*/
809
-extern int check_replace_refs;
809
+extern int read_replace_refs;
810
extern char *git_replace_ref_base;
811
812
extern int fsync_object_files;
environment.c
+2
-2
@@ -51,7 +51,7 @@ const char *editor_program;
51
const char *askpass_program;
52
const char *excludes_file;
53
enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
54
-int check_replace_refs = 1; /* NEEDSWORK: rename to read_replace_refs */
54
+int read_replace_refs = 1;
55
char *git_replace_ref_base;
56
enum eol core_eol = EOL_UNSET;
57
int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
@@ -183,7 +183,7 @@ void setup_git_env(const char *git_dir)
183
argv_array_clear(&to_free);
184
185
if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
186
- check_replace_refs = 0;
186
+ read_replace_refs = 0;
187
replace_ref_base = getenv(GIT_REPLACE_REF_BASE_ENVIRONMENT);
188
free(git_replace_ref_base);
189
git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base
git.c
+1
-1
@@ -164,7 +164,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
164
if (envchanged)
165
*envchanged = 1;
166
} else if (!strcmp(cmd, "--no-replace-objects")) {
167
- check_replace_refs = 0;
167
+ read_replace_refs = 0;
168
setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
169
if (envchanged)
170
*envchanged = 1;
log-tree.c
+1
-1
@@ -91,7 +91,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
91
92
if (starts_with(refname, git_replace_ref_base)) {
93
struct object_id original_oid;
94
- if (!check_replace_refs)
94
+ if (!read_replace_refs)
95
return 0;
96
if (get_oid_hex(refname + strlen(git_replace_ref_base),
97
&original_oid)) {
replace-object.c
+1
-1
@@ -51,7 +51,7 @@ static void prepare_replace_object(struct repository *r)
51
* replacement object's name (replaced recursively, if necessary).
52
* The return value is either oid or a pointer to a
53
* permanently-allocated value. This function always respects replace
54
- * references, regardless of the value of check_replace_refs.
54
+ * references, regardless of the value of read_replace_refs.
55
*/
56
const struct object_id *do_lookup_replace_object(struct repository *r,
57
const struct object_id *oid)
replace-object.h
+1
-1
@@ -26,7 +26,7 @@ extern const struct object_id *do_lookup_replace_object(struct repository *r,
26
static inline const struct object_id *lookup_replace_object(struct repository *r,
27
const struct object_id *oid)
28
{
29
- if (!check_replace_refs ||
29
+ if (!read_replace_refs ||
30
(r->objects->replace_map &&
31
r->objects->replace_map->map.tablesize == 0))
32
return oid;