summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2016-07-26 18:06:17 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-07-26 11:13:44 -0700
commitfbc87eb54409b5c7b080f1c23b767daefc9d6ede (patch)
tree6b3935a387378544caf4d26f13cef11ed2863cf5
parentmerge-recursive: avoid returning a wholesale struct (diff)
downloadtgif-fbc87eb54409b5c7b080f1c23b767daefc9d6ede.tar.xz
merge-recursive: allow write_tree_from_memory() to error out
It is possible that a tree cannot be written (think: disk full). We will want to give the caller a chance to clean up instead of letting the program die() in such a case. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--merge-recursive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 2be1e17e08..1f86338ad3 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1888,8 +1888,8 @@ int merge_trees(struct merge_options *o,
else
clean = 1;
- if (o->call_depth)
- *result = write_tree_from_memory(o);
+ if (o->call_depth && !(*result = write_tree_from_memory(o)))
+ return -1;
return clean;
}