X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git.c;h=78ed403ed121a84c3efe3a57fa7c24486d724953;hb=ece634d1478a9f1bf19eed8a6b7dee305fadd46e;hp=5cb0d32070bfdc067ac02c4a5186c3f2db3d5619;hpb=4da8cbc234177d6a8cf749d4ef60bd05ec843898;p=git.git diff --git a/git.c b/git.c index 5cb0d320..78ed403e 100644 --- a/git.c +++ b/git.c @@ -354,7 +354,7 @@ static int cmd_log(int argc, const char **argv, char **envp) prepare_revision_walk(&rev); setup_pager(); while ((commit = get_revision(&rev)) != NULL) { - if (commit_format != CMIT_FMT_ONELINE && shown) + if (shown && do_diff && commit_format != CMIT_FMT_ONELINE) putchar('\n'); fputs(commit_prefix, stdout); if (abbrev_commit && abbrev) @@ -391,6 +391,8 @@ static int cmd_log(int argc, const char **argv, char **envp) if (do_diff) log_tree_commit(&opt, commit); shown = 1; + free(commit->buffer); + commit->buffer = NULL; } free(buf); return 0;