aboutsummaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-22 11:27:26 -0800
committerJunio C Hamano <gitster@pobox.com>2011-12-22 11:27:26 -0800
commitf35ccd9be2db9a55afd09ed1a9338c758fa63d82 (patch)
treec94f3c518cdadb2c478e066547f152d3c753fb36 /builtin/merge.c
parent52b9d2cf7fbde061bf0d3336e3a89d7333d5b23d (diff)
parent37576c14439a4dfa43bec5a5c953fea1cc436bbf (diff)
downloadgit-f35ccd9be2db9a55afd09ed1a9338c758fa63d82.tar.gz
git-f35ccd9be2db9a55afd09ed1a9338c758fa63d82.tar.xz
Merge branch 'nd/war-on-nul-in-commit'
* nd/war-on-nul-in-commit: commit_tree(): refuse commit messages that contain NULs Convert commit_tree() to take strbuf as message merge: abort if fails to commit Conflicts: builtin/commit.c commit.c commit.h
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 24579409c..a89616579 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -910,7 +910,8 @@ static int merge_trivial(struct commit *head)
parent->next->item = remoteheads->item;
parent->next->next = NULL;
prepare_to_commit();
- commit_tree(merge_msg.buf, result_tree, parent, result_commit, NULL);
+ if (commit_tree(&merge_msg, result_tree, parent, result_commit, NULL))
+ die(_("failed to write commit object"));
finish(head, result_commit, "In-index merge");
drop_save();
return 0;
@@ -941,7 +942,8 @@ static int finish_automerge(struct commit *head,
strbuf_addch(&merge_msg, '\n');
prepare_to_commit();
free_commit_list(remoteheads);
- commit_tree(merge_msg.buf, result_tree, parents, result_commit, NULL);
+ if (commit_tree(&merge_msg, result_tree, parents, result_commit, NULL))
+ die(_("failed to write commit object"));
strbuf_addf(&buf, "Merge made by the '%s' strategy.", wt_strategy);
finish(head, result_commit, buf.buf);
strbuf_release(&buf);