cache.h: add GITMODULES_FILE macro

Add a macro to be used when specifying the '.gitmodules' file and
convert any existing hard coded '.gitmodules' file strings to use the
new macro.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams
2017-08-02 12:49:16 -07:00
committed by Junio C Hamano
parent ba43964d47
commit 4c0eeafe47
3 changed files with 12 additions and 11 deletions

View File

@ -286,7 +286,7 @@ static void reload_gitmodules_file(struct index_state *index,
for (i = 0; i < index->cache_nr; i++) {
struct cache_entry *ce = index->cache[i];
if (ce->ce_flags & CE_UPDATE) {
int r = strcmp(ce->name, ".gitmodules");
int r = strcmp(ce->name, GITMODULES_FILE);
if (r < 0)
continue;
else if (r == 0) {