[PATCH 18/22] teach diff.c to use cache_find_name()
Signed-off-by: Chuck Lever <cel@netapp.com>
---
diff.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -244,7 +244,6 @@ static int work_tree_matches(const char
{
struct cache_entry *ce;
struct stat st;
- int pos, len;
/* We do not read the cache ourselves here, because the
* benchmark with my previous version that always reads cache
@@ -261,11 +260,8 @@ static int work_tree_matches(const char
if (read_cache_needed())
return 0;
- len = strlen(name);
- pos = cache_name_pos(name, len);
- if (pos < 0)
+ if (!cache_find_entry(name, strlen(name), &ce))
return 0;
- ce = active_cache[pos];
if ((lstat(name, &st) < 0) ||
!S_ISREG(st.st_mode) || /* careful! */
ce_match_stat(ce, &st) ||