aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cache-tree.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 0bbec4321..4d439bd91 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -564,10 +564,9 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
if (!sub)
return NULL;
it = sub->cache_tree;
- if (slash)
- while (*slash && *slash == '/')
- slash++;
- if (!slash || !*slash)
+ while (*slash && *slash == '/')
+ slash++;
+ if (!*slash)
return it; /* prefix ended with slashes */
path = slash;
}