Merge branch 'dt/submodule-rm-with-stale-cache'

Running "git rm" on a submodule failed unnecessarily when
.gitmodules is only cache-dirty, which has been corrected.

* dt/submodule-rm-with-stale-cache:
  git rm submodule: succeed if .gitmodules index stat info is zero
This commit is contained in:
Junio C Hamano
2020-02-12 12:41:35 -08:00
2 changed files with 8 additions and 1 deletions

View File

@ -82,7 +82,7 @@ int is_staging_gitmodules_ok(struct index_state *istate)
if ((pos >= 0) && (pos < istate->cache_nr)) {
struct stat st;
if (lstat(GITMODULES_FILE, &st) == 0 &&
ie_match_stat(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)
ie_modified(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)
return 0;
}