diff --git a/unpack-trees.c b/unpack-trees.c index 0cdf19817d..da68557b17 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -315,6 +315,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str static int unpack_failed(struct unpack_trees_options *o, const char *message) { + discard_index(&o->result); if (!o->gently) { if (message) return error(message);