summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-20 21:20:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-12-20 21:22:41 (GMT)
commit0074d18dc0d816f9842d3e0e1cd0b26341715b37 (patch)
treeaf52ae3077c10d8d6940b10af46bf47a25cdf6e6 /builtin/commit.c
parent96b8d93a539f3a9f43f0fc38214db8753cac3c2e (diff)
downloadgit-0074d18dc0d816f9842d3e0e1cd0b26341715b37.zip
git-0074d18dc0d816f9842d3e0e1cd0b26341715b37.tar.gz
git-0074d18dc0d816f9842d3e0e1cd0b26341715b37.tar.bz2
commit: do not lose mergetag header when not amending
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>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index fca7ea0..0c64c88 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -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)) {