aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-12-15 20:47:21 +0700
committerJunio C Hamano <gitster@pobox.com>2011-12-15 10:26:40 -0800
commit6b3c4c05475d206fafd650d8d27c82a8b051ac30 (patch)
tree27f373e9010a360baa923ed945483cec719779a9 /builtin
parent406da7803217998ff6bf5dc69c55b1613556c2f4 (diff)
downloadgit-6b3c4c05475d206fafd650d8d27c82a8b051ac30.tar.gz
git-6b3c4c05475d206fafd650d8d27c82a8b051ac30.tar.xz
merge: abort if fails to commit
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/merge.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 2870a6af6..27576c0f7 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -913,7 +913,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.buf, result_tree, parent, result_commit, NULL))
+ die(_("failed to write commit object"));
finish(head, result_commit, "In-index merge");
drop_save();
return 0;
@@ -944,7 +945,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.buf, 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);