Skip to content

Commit

Permalink
commit: do not lose mergetag header when not amending
Browse files Browse the repository at this point in the history
The earlier ed7a42a (commit: teach --amend to carry forward extra headers,
2011-11-08) broke "git merge/pull; edit to fix conflict; git commit"
workflow by forgetting that commit_tree_extended() takes the whole extra
header list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Dec 20, 2011
1 parent 96b8d93 commit 0074d18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
exit(1);
}

if (amend)
if (amend) {
extra = read_commit_extra_headers(current_head);
} else {
struct commit_extra_header **tail = &extra;
append_merge_tag_headers(parents, &tail);
}

if (commit_tree_extended(sb.buf, active_cache_tree->sha1, parents, sha1,
author_ident.buf, extra)) {
Expand Down

0 comments on commit 0074d18

Please sign in to comment.