summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index d5f4d997da..da4d6d4ec0 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1309,14 +1309,14 @@ static int clear_ce_flags_dir(struct index_state *istate,
if (pl->use_cone_patterns && orig_ret == MATCHED_RECURSIVE) {
struct cache_entry **ce = cache;
- rc = (cache_end - cache) / sizeof(struct cache_entry *);
+ rc = cache_end - cache;
while (ce < cache_end) {
(*ce)->ce_flags &= ~clear_mask;
ce++;
}
} else if (pl->use_cone_patterns && orig_ret == NOT_MATCHED) {
- rc = (cache_end - cache) / sizeof(struct cache_entry *);
+ rc = cache_end - cache;
} else {
rc = clear_ce_flags_1(istate, cache, cache_end - cache,
prefix,
@@ -1352,7 +1352,7 @@ static int clear_ce_flags_1(struct index_state *istate,
enum pattern_match_result default_match,
int progress_nr)
{
- struct cache_entry **cache_end = cache + nr;
+ struct cache_entry **cache_end = nr ? cache + nr : cache;
/*
* Process all entries that have the given prefix and meet