submodule.c: stricter checking for submodules in is_submodule_modified
By having a stricter check in the superproject we catch errors earlier, instead of spawning a child process to tell us. Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
fcecf0b968
commit
5c896f7c3e
@ -1052,11 +1052,12 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
|
||||
git_dir = read_gitfile(buf.buf);
|
||||
if (!git_dir)
|
||||
git_dir = buf.buf;
|
||||
if (!is_directory(git_dir)) {
|
||||
if (!is_git_directory(git_dir)) {
|
||||
if (is_directory(git_dir))
|
||||
die(_("'%s' not recognized as a git repository"), git_dir);
|
||||
strbuf_release(&buf);
|
||||
/* The submodule is not checked out, so it is not modified */
|
||||
return 0;
|
||||
|
||||
}
|
||||
strbuf_reset(&buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user