X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git.c;h=78ed403ed121a84c3efe3a57fa7c24486d724953;hb=dfdcb558ecf93c0e09b8dab89cff4839e8c95e36;hp=ad896da5849b9697cf61d7349ee7d4e20611106d;hpb=477f2b41310c4b1040a9e7f72720b9c39d82caf9;p=git.git diff --git a/git.c b/git.c index ad896da5..78ed403e 100644 --- a/git.c +++ b/git.c @@ -15,8 +15,8 @@ #include "cache.h" #include "commit.h" -#include "revision.h" #include "diff.h" +#include "revision.h" #include "log-tree.h" #ifndef PATH_MAX @@ -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;