Skip to content

Commit

Permalink
submodule.c: stricter checking for submodules in is_submodule_modified
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stefanbeller authored and gitster committed Mar 27, 2017
1 parent fcecf0b commit 5c896f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions submodule.c
Expand Up @@ -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);

Expand Down

0 comments on commit 5c896f7

Please sign in to comment.