From fbc87eb54409b5c7b080f1c23b767daefc9d6ede Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 26 Jul 2016 18:06:17 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- merge-recursive.c | 4 ++-- 1 file 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; } -- cgit v1.2.3