summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@SteelEye.com>2005-04-18 11:44:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-18 11:44:31 -0700
commita4b7dbef4ef53f4fffbda0a6f5eada4c377e3fc5 (patch)
treeffff612a9cb5d5f390c1aeadaf2bd1e8c3d33ded /read-cache.c
parent1bc992acacf5961e65d9fdddeb8561284e708c74 (diff)
downloadgit-a4b7dbef4ef53f4fffbda0a6f5eada4c377e3fc5.tar.gz
[PATCH] fix bug in read-cache.c which loses files when merging a tree
I noticed this when I tried a non-trivial scsi merge and checked the results against BK. The problem is that remove_entry_at() actually decrements active_nr, so decrementing it in add_cache_entry() before calling remove_entry_at() is a double decrement (hence we lose cache entries at the end).
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 042b0c2107..8571ba2f0f 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -402,7 +402,6 @@ int add_cache_entry(struct cache_entry *ce, int ok_to_add)
if (pos < active_nr && ce_stage(ce) == 0) {
while (same_name(active_cache[pos], ce)) {
ok_to_add = 1;
- active_nr--;
if (!remove_entry_at(pos))
break;
}