Skip to content

Commit

Permalink
cache_tree_find(): use path variable when passing over slashes
Browse files Browse the repository at this point in the history
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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Mar 5, 2014
1 parent 8b7e5f7 commit 3491047
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,10 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
if (!sub)
return NULL;
it = sub->cache_tree;
while (*slash == '/')
slash++;

path = slash;
while (*path == '/')
path++;
}
return it;
}
Expand Down

0 comments on commit 3491047

Please sign in to comment.