[PATCH 2/3] submodule.c, is_submodule_modified: stricter checking for submodules
- From
Stefan Beller <sbeller@google.com>
- Date
- Mar 23, 2017, 00:43 UTC
- Message-ID
- <20170323004329.15892-3-sbeller@google.com>
- In-Reply-To
- <20170323004329.15892-1-sbeller@google.com>
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> --- submodule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/submodule.c b/submodule.c index d355ddb46b..66335159ae 100644 --- a/submodule.c +++ b/submodule.c @@ -1050,11 +1050,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);
-- 2.12.1.432.gfe308fe33c.dirty