X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=builtin-merge.c;h=18571387f11b0ce5b5131f4e3cedd5064fa8e492;hb=1a507b9cf75bcb2de2391c584539e0ff202549bf;hp=e95c5dc71746fb6f4e87913669701a2f65070602;hpb=f01d74960363736caaf4d98d39555e99bdc72c25;p=thirdparty%2Fgit.git diff --git a/builtin-merge.c b/builtin-merge.c index e95c5dc717..18571387f1 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -264,6 +264,7 @@ static void squash_message(void) struct strbuf out = STRBUF_INIT; struct commit_list *j; int fd; + struct pretty_print_context ctx = {0}; printf("Squash commit -- not updating HEAD\n"); fd = open(git_path("SQUASH_MSG"), O_WRONLY | O_CREAT, 0666); @@ -285,13 +286,15 @@ static void squash_message(void) if (prepare_revision_walk(&rev)) die("revision walk setup failed"); + ctx.abbrev = rev.abbrev; + ctx.date_mode = rev.date_mode; + strbuf_addstr(&out, "Squashed commit of the following:\n"); while ((commit = get_revision(&rev)) != NULL) { strbuf_addch(&out, '\n'); strbuf_addf(&out, "commit %s\n", sha1_to_hex(commit->object.sha1)); - pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev, - NULL, NULL, rev.date_mode, 0); + pretty_print_commit(rev.commit_format, commit, &out, &ctx); } if (write(fd, out.buf, out.len) < 0) die_errno("Writing SQUASH_MSG");