submodule: check for unstaged .gitmodules outside of config parsing
Teach 'is_staging_gitmodules_ok()' to be able to determine in the '.gitmodules' file has unstaged changes based on the passed in index instead of relying on a global variable which is set during the submodule-config parsing. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
8fa2915971
commit
91b834807b
@ -286,7 +286,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
|
||||
list.entry[list.nr].name = xstrdup(ce->name);
|
||||
list.entry[list.nr].is_submodule = S_ISGITLINK(ce->ce_mode);
|
||||
if (list.entry[list.nr++].is_submodule &&
|
||||
!is_staging_gitmodules_ok())
|
||||
!is_staging_gitmodules_ok(&the_index))
|
||||
die (_("Please stage your changes to .gitmodules or stash them to proceed"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user