Skip to content

Commit 67f61ef

Browse files
novalisgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f1c0368 commit 67f61ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

submodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,10 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
720720
strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=.");
721721
}
722722

723-
if (start_command(&cp))
723+
if (start_command(&cp)) {
724724
diff_emit_submodule_error(o, "(diff failed)\n");
725+
goto done;
726+
}
725727

726728
while (strbuf_getwholeline_fd(&sb, cp.out, '\n') != EOF)
727729
diff_emit_submodule_pipethrough(o, sb.buf, sb.len);

0 commit comments

Comments
 (0)