diff options
author | Brandon Williams <bmwill@google.com> | 2017-12-12 11:53:51 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-12 12:35:21 -0800 |
commit | 7da9aba417868afa11ef0baa4078dc2dadde5333 (patch) | |
tree | 527b9b12cb223db899b800c32edaf9edced27898 /submodule.c | |
parent | 3b8317a9e6f1538c99074eeffd4b27ac18de5648 (diff) | |
download | git-7da9aba417868afa11ef0baa4078dc2dadde5333.tar.gz |
submodule: used correct index in is_staging_gitmodules_ok
Commit 883e248b8 (fsmonitor: teach git to optionally utilize a file
system monitor to speed up detecting new or changed files., 2017-09-22)
introduced a call to 'ce_match_stat()' in 'is_staging_gitmodules_ok()'
which implicitly relys on the the global 'the_index' instead of the
passed in 'struct index_state'. Fix this by changing the call to
'ie_match_stat()' and using the passed in index_state struct.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c index 7097be806e..a9670eaae8 100644 --- a/submodule.c +++ b/submodule.c @@ -55,14 +55,15 @@ int is_gitmodules_unmerged(const struct index_state *istate) * future version when we learn to stage the changes we do ourselves without * staging any previous modifications. */ -int is_staging_gitmodules_ok(const struct index_state *istate) +int is_staging_gitmodules_ok(struct index_state *istate) { int pos = index_name_pos(istate, GITMODULES_FILE, strlen(GITMODULES_FILE)); if ((pos >= 0) && (pos < istate->cache_nr)) { struct stat st; if (lstat(GITMODULES_FILE, &st) == 0 && - ce_match_stat(istate->cache[pos], &st, CE_MATCH_IGNORE_FSMONITOR) & DATA_CHANGED) + ie_match_stat(istate, istate->cache[pos], &st, + CE_MATCH_IGNORE_FSMONITOR) & DATA_CHANGED) return 0; } |