Skip to content

Commit 6ebd1ca

Browse files
peffgitster
authored andcommitted
check_replace_refs: rename to read_replace_refs
This was added as a NEEDSWORK in c3c36d7 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 72470aa commit 6ebd1ca

13 files changed

+14
-14
lines changed

Diff for: builtin/fsck.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
689689
fetch_if_missing = 0;
690690

691691
errors_found = 0;
692-
check_replace_refs = 0;
692+
read_replace_refs = 0;
693693

694694
argc = parse_options(argc, argv, prefix, fsck_opts, fsck_usage, 0);
695695

Diff for: builtin/index-pack.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
16791679
if (argc == 2 && !strcmp(argv[1], "-h"))
16801680
usage(index_pack_usage);
16811681

1682-
check_replace_refs = 0;
1682+
read_replace_refs = 0;
16831683
fsck_options.walk = mark_link;
16841684

16851685
reset_pack_idx_option(&opts);

Diff for: builtin/pack-objects.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
31883188
if (DFS_NUM_STATES > (1 << OE_DFS_STATE_BITS))
31893189
BUG("too many dfs states, increase OE_DFS_STATE_BITS");
31903190

3191-
check_replace_refs = 0;
3191+
read_replace_refs = 0;
31923192

31933193
reset_pack_idx_option(&pack_idx_opts);
31943194
git_config(git_pack_config, NULL);

Diff for: builtin/prune.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
118118

119119
expire = TIME_MAX;
120120
save_commit_buffer = 0;
121-
check_replace_refs = 0;
121+
read_replace_refs = 0;
122122
ref_paranoia = 1;
123123
init_revisions(&revs, prefix);
124124

Diff for: builtin/replace.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
544544
OPT_END()
545545
};
546546

547-
check_replace_refs = 0;
547+
read_replace_refs = 0;
548548
git_config(git_default_config, NULL);
549549

550550
argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);

Diff for: builtin/unpack-objects.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
513513
int i;
514514
struct object_id oid;
515515

516-
check_replace_refs = 0;
516+
read_replace_refs = 0;
517517

518518
git_config(git_default_config, NULL);
519519

Diff for: builtin/upload-pack.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
3131
};
3232

3333
packet_trace_identity("upload-pack");
34-
check_replace_refs = 0;
34+
read_replace_refs = 0;
3535

3636
argc = parse_options(argc, argv, NULL, options, upload_pack_usage, 0);
3737

Diff for: cache.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ void reset_shared_repository(void);
806806
* $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
807807
* commands that do not want replace references to be active.
808808
*/
809-
extern int check_replace_refs;
809+
extern int read_replace_refs;
810810
extern char *git_replace_ref_base;
811811

812812
extern int fsync_object_files;

Diff for: environment.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const char *editor_program;
5151
const char *askpass_program;
5252
const char *excludes_file;
5353
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;
5555
char *git_replace_ref_base;
5656
enum eol core_eol = EOL_UNSET;
5757
int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
@@ -183,7 +183,7 @@ void setup_git_env(const char *git_dir)
183183
argv_array_clear(&to_free);
184184

185185
if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
186-
check_replace_refs = 0;
186+
read_replace_refs = 0;
187187
replace_ref_base = getenv(GIT_REPLACE_REF_BASE_ENVIRONMENT);
188188
free(git_replace_ref_base);
189189
git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base

Diff for: git.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
164164
if (envchanged)
165165
*envchanged = 1;
166166
} else if (!strcmp(cmd, "--no-replace-objects")) {
167-
check_replace_refs = 0;
167+
read_replace_refs = 0;
168168
setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
169169
if (envchanged)
170170
*envchanged = 1;

Diff for: log-tree.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
9191

9292
if (starts_with(refname, git_replace_ref_base)) {
9393
struct object_id original_oid;
94-
if (!check_replace_refs)
94+
if (!read_replace_refs)
9595
return 0;
9696
if (get_oid_hex(refname + strlen(git_replace_ref_base),
9797
&original_oid)) {

Diff for: replace-object.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void prepare_replace_object(struct repository *r)
5151
* replacement object's name (replaced recursively, if necessary).
5252
* The return value is either oid or a pointer to a
5353
* 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.
5555
*/
5656
const struct object_id *do_lookup_replace_object(struct repository *r,
5757
const struct object_id *oid)

Diff for: replace-object.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extern const struct object_id *do_lookup_replace_object(struct repository *r,
2626
static inline const struct object_id *lookup_replace_object(struct repository *r,
2727
const struct object_id *oid)
2828
{
29-
if (!check_replace_refs ||
29+
if (!read_replace_refs ||
3030
(r->objects->replace_map &&
3131
r->objects->replace_map->map.tablesize == 0))
3232
return oid;

0 commit comments

Comments
 (0)