unpack-trees: don't perform any index operation if we're not merging
src[0] points to the index entry in the merge case and to the first tree to unpack in the non-merge case. We only want to mark the index entry, so check first if we're merging. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Apr 10, 2012 at 20:55 UTC
97e5954bdcf46c76e4a8147172ff7c5a4f633e0d
1 file changed
+1
-1
unpack-trees.c
+1
-1
@@ -772,7 +772,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
772
if (unpack_nondirectories(n, mask, dirmask, src, names, info) < 0)
773
return -1;
774
775
- if (src[0]) {
775
+ if (o->merge && src[0]) {
776
if (ce_stage(src[0]))
777
mark_ce_used_same_name(src[0], o);
778
else