summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twosigma.com>2021-08-31 13:12:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-31 17:12:13 (GMT)
commit67f61efbb92dce64b33c3280b89e9f253a34df1c (patch)
treee129b71cdee0df0f5f59a9619a40814495943c5b /submodule.c
parentf1c0368da4d64f394e4c099cb3c232671040d725 (diff)
downloadgit-67f61efbb92dce64b33c3280b89e9f253a34df1c.zip
git-67f61efbb92dce64b33c3280b89e9f253a34df1c.tar.gz
git-67f61efbb92dce64b33c3280b89e9f253a34df1c.tar.bz2
diff --submodule=diff: don't print failure message twice
When we fail to start a diff command inside a submodule, immediately exit the routine rather than trying to finish the command and printing a second message. Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index 8aeff95..ab5f050 100644
--- a/submodule.c
+++ b/submodule.c
@@ -720,8 +720,10 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=.");
}
- if (start_command(&cp))
+ if (start_command(&cp)) {
diff_emit_submodule_error(o, "(diff failed)\n");
+ goto done;
+ }
while (strbuf_getwholeline_fd(&sb, cp.out, '\n') != EOF)
diff_emit_submodule_pipethrough(o, sb.buf, sb.len);