Skip to content

Commit 6f4780f

Browse files
author
Junio C Hamano
committed
diff --stat: do not do its own three-dashes.
I missed that "git-diff-* --stat" spits out three-dash separator on its own without being asked. Remove it. When we output commit log followed by diff, perhaps --patch-with-stat, for downstream consumer, we _would_ want the three-dash between the message and the diff material, but that logic belongs to the caller, not diff generator. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 5069b1c commit 6f4780f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

diff.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ static void show_stats(struct diffstat_t* data)
245245
if (data->nr == 0)
246246
return;
247247

248-
printf("---\n");
249-
250248
for (i = 0; i < data->nr; i++) {
251249
struct diffstat_file *file = data->files[i];
252250

git.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,10 @@ static int cmd_log(int argc, const char **argv, char **envp)
388388
pretty_print_commit(commit_format, commit, ~0, buf,
389389
LOGSIZE, abbrev);
390390
printf("%s\n", buf);
391-
if (do_diff)
391+
if (do_diff) {
392+
printf("---\n");
392393
log_tree_commit(&opt, commit);
394+
}
393395
shown = 1;
394396
free(commit->buffer);
395397
commit->buffer = NULL;

0 commit comments

Comments
 (0)