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>
This commit is contained in:
Johannes Schindelin 2016-07-26 18:06:17 +02:00 коммит произвёл Junio C Hamano
Родитель 3c8a51e89a
Коммит fbc87eb544
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;
}