aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-30 13:20:33 -0700
committerJunio C Hamano <gitster@pobox.com>2020-07-30 13:20:33 -0700
commita20e20e4c8fe6c13e03af8109644a84d8f4e7f7f (patch)
treee455d6f3885e6b947ca4705bd94335c7430671f4
parentMerge branch 'jt/avoid-lazy-fetching-upon-have-check' into master (diff)
parentread-cache: remove bogus shortcut (diff)
downloadgit-a20e20e4c8fe6c13e03af8109644a84d8f4e7f7f.tar.gz
git-a20e20e4c8fe6c13e03af8109644a84d8f4e7f7f.zip
Merge branch 'rs/add-index-entry-optim-fix' into master
Fix to an ancient bug caused by an over-eager attempt for optimization. * rs/add-index-entry-optim-fix: read-cache: remove bogus shortcut
-rw-r--r--read-cache.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/read-cache.c b/read-cache.c
index aa427c5c17..8ed1c29b54 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1171,20 +1171,6 @@ static int has_dir_name(struct index_state *istate,
return retval;
}
- if (istate->cache_nr > 0 &&
- ce_namelen(istate->cache[istate->cache_nr - 1]) > len) {
- /*
- * The directory prefix lines up with part of
- * a longer file or directory name, but sorts
- * after it, so this sub-directory cannot
- * collide with a file.
- *
- * last: xxx/yy-file (because '-' sorts before '/')
- * this: xxx/yy/abc
- */
- return retval;
- }
-
/*
* This is a possible collision. Fall through and
* let the regular search code handle it.