{"thread":{"id":"29214","subject":"[PATCH] commit: do not lose mergetag header when not amending","startedAt":"2011-12-20T21:24:54Z","lastAt":"2011-12-20T21:24:54Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"181540","messageId":"7v4nwvj5qx.fsf@alter.siamese.dyndns.org","threadId":"29214","inReplyTo":null,"subject":"[PATCH] commit: do not lose mergetag header when not amending","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-20T21:24:54Z","receivedAt":"2011-12-20T21:24:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The earlier ed7a42a (commit: teach --amend to carry forward extra headers,\n2011-11-08) broke \"git merge/pull; edit to fix conflict; git commit\"\nworkflow by forgetting that commit_tree_extended() takes the whole extra\nheader list.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * Will directly queue to 'master'.\n\n builtin/commit.c |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex fca7ea0..0c64c88 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1484,8 +1484,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\texit(1);\n \t}\n \n-\tif (amend)\n+\tif (amend) {\n \t\textra = read_commit_extra_headers(current_head);\n+\t} else {\n+\t\tstruct commit_extra_header **tail = &extra;\n+\t\tappend_merge_tag_headers(parents, &tail);\n+\t}\n \n \tif (commit_tree_extended(sb.buf, active_cache_tree->sha1, parents, sha1,\n \t\t\t\t author_ident.buf, extra)) {\n-- \n1.7.8.376.g7c0c1\n"}]}