Skip to content

Commit 3491047

Browse files
mhaggergitster
authored andcommitted
cache_tree_find(): use path variable when passing over slashes
The search for the end of the slashes is part of the update of the path variable for the next iteration as opposed to an update of the slash variable. So iterate using path rather than slash. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8b7e5f7 commit 3491047

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cache-tree.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,10 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
563563
if (!sub)
564564
return NULL;
565565
it = sub->cache_tree;
566-
while (*slash == '/')
567-
slash++;
566+
568567
path = slash;
568+
while (*path == '/')
569+
path++;
569570
}
570571
return it;
571572
}

0 commit comments

Comments
 (0)