From: René Scharfe Date: Tue, 10 Apr 2012 18:55:58 +0000 (+0200) Subject: unpack-trees: don't perform any index operation if we're not merging X-Git-Tag: v1.7.10.2~7^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=97e5954bdcf46c76e4a8147172ff7c5a4f633e0d;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/unpack-trees.c b/unpack-trees.c index 7c9ecf665..60b728e49 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -772,7 +772,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str if (unpack_nondirectories(n, mask, dirmask, src, names, info) < 0) return -1; - if (src[0]) { + if (o->merge && src[0]) { if (ce_stage(src[0])) mark_ce_used_same_name(src[0], o); else