summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-04-12 00:21:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-12 02:38:56 (GMT)
commitc3c36d7de2cf09fb05701ed672b26c51a008f5cd (patch)
tree916724272a8de00b2c5cd69130790cb0b59ade17 /environment.c
parentc1274495ce74cb71c8c6e9e16490d6c4d2d1fe22 (diff)
downloadgit-c3c36d7de2cf09fb05701ed672b26c51a008f5cd.zip
git-c3c36d7de2cf09fb05701ed672b26c51a008f5cd.tar.gz
git-c3c36d7de2cf09fb05701ed672b26c51a008f5cd.tar.bz2
replace-object: check_replace_refs is safe in multi repo environment
In e1111cef23 (inline lookup_replace_object() calls, 2011-05-15) a shortcut for checking the object replacement was added by setting check_replace_refs to 0 once the replacements were evaluated to not exist. This works fine in with the assumption of only one repository in existence. The assumption won't hold true any more when we work on multiple instances of a repository structs (e.g. one struct per submodule), as the first repository to be inspected may have no replacements and would set the global variable. Other repositories would then completely omit their evaluation of replacements. This reverts back the meaning of the flag `check_replace_refs` of "Do we need to check with the lookup table?" to "Do we need to read the replacement definition?", adding the bypassing logic to lookup_replace_object after the replacement definition was read. As with the original patch, delay the renaming of the global variable Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/environment.c b/environment.c
index 39b3d90..b991fc0 100644
--- a/environment.c
+++ b/environment.c
@@ -50,7 +50,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;
+int check_replace_refs = 1; /* NEEDSWORK: rename to read_replace_refs */
char *git_replace_ref_base;
enum eol core_eol = EOL_UNSET;
int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;