Skip to content

Commit 6a5ceda

Browse files
jlehmanngitster
authored andcommitted
diff/status: print submodule path when looking for changes fails
diff and status run "git status --porcelain" inside each populated submodule to see if it contains changes (unless told not to do so via config or command line option). When that fails, e.g. due to a corrupt submodule .git directory, it just prints "git status --porcelain failed" or "Could not run git status --porcelain" without giving the user a clue where that happened. Add '"in submodule %s", path' to these error strings to tell the user where exactly the problem occurred. Reported-by: Seth Robertson <[email protected]> Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ee6fc51 commit 6a5ceda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

submodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ int is_submodule_modified(const char *path)
148148
cp.no_stdin = 1;
149149
cp.out = -1;
150150
if (start_command(&cp))
151-
die("Could not run git status --porcelain");
151+
die("Could not run 'git status --porcelain' in submodule %s", path);
152152

153153
len = strbuf_read(&buf, cp.out, 1024);
154154
close(cp.out);
155155

156156
if (finish_command(&cp))
157-
die("git status --porcelain failed");
157+
die("'git status --porcelain' failed in submodule %s", path);
158158

159159
free(env[0]);
160160
free(env[1]);

0 commit comments

Comments
 (0)