summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorLibravatar Stefan Beller <sbeller@google.com>2017-03-24 17:36:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-27 09:48:19 -0700
commit5c896f7c3ec69f017d1e1be4164d558918f3ae4c (patch)
tree3063c5e74a79494457e286c0022e7615c7a9e9be /submodule.c
parentsubmodule.c: port is_submodule_modified to use porcelain 2 (diff)
downloadtgif-5c896f7c3ec69f017d1e1be4164d558918f3ae4c.tar.xz
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>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c
index 5865795b9f..fa21c7bb72 100644
--- a/submodule.c
+++ b/submodule.c
@@ -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);