diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-05-03 15:12:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-04 09:17:50 -0700 |
commit | 663c1295d8a6a591a805692d311e1d709e3193e2 (patch) | |
tree | fcd7e0bfbdbf381c7c6d74f7dfad440dd017376b /refs.c | |
parent | 28e6a34e254a1ee5fc3d106e4a6117fd02254589 (diff) | |
download | git-663c1295d8a6a591a805692d311e1d709e3193e2.tar.gz git-663c1295d8a6a591a805692d311e1d709e3193e2.tar.xz |
refs: fix find_containing_dir() regression
The function used to return NULL when asked to find the containing
directory for a ref that does not exist, allowing the caller to
omit iteration altogether. But a misconversion in an earlier change
"refs.c: extract function search_for_subdir()" started returning the
top-level directory entry, forcing callers to walk everything.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -390,8 +390,10 @@ static struct ref_dir *find_containing_dir(struct ref_dir *dir, refname + dirname.len, (slash + 1) - (refname + dirname.len)); subdir = search_for_subdir(dir, dirname.buf, mkdir); - if (!subdir) + if (!subdir) { + dir = NULL; break; + } dir = subdir; } |