Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
merge: abort if fails to commit
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Thu, 15 Dec 2011 13:47:21 +0000
(20:47 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 15 Dec 2011 18:26:40 +0000
(10:26 -0800)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
406da78
)
diff --git
a/builtin/merge.c
b/builtin/merge.c
index 2870a6af6fbc868455f2961483cfbfdb065a1a14..27576c0f7fa3bf370437f3ba1cd4e7ff36fadfdb 100644
(file)
--- 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();
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;
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);
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);
strbuf_addf(&buf, "Merge made by the '%s' strategy.", wt_strategy);
finish(head, result_commit, buf.buf);
strbuf_release(&buf);