summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0190457)
raw | patch | inline | side by side (parent: 0190457)
author | Linus Torvalds <torvalds@linux-foundation.org> | |
Thu, 6 Mar 2008 23:44:48 +0000 (15:44 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 9 Mar 2008 08:43:47 +0000 (00:43 -0800) |
When we make the "root" tree-walk info entry have a pathname in it, we
need to have a ->prev pointer so that compare_entry will actually notice
and traverse into the root.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
need to have a ->prev pointer so that compare_entry will actually notice
and traverse into the root.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-walk.c | patch | blob | history |
diff --git a/tree-walk.c b/tree-walk.c
index 842cb6ad2e4086610cb4f268be14ec0cddf2ee4e..02e2aed7737207225f1b96eed774a1b75dd6d8d9 100644 (file)
--- a/tree-walk.c
+++ b/tree-walk.c
void setup_traverse_info(struct traverse_info *info, const char *base)
{
int pathlen = strlen(base);
+ static struct traverse_info dummy;
memset(info, 0, sizeof(*info));
if (pathlen && base[pathlen-1] == '/')
info->pathlen = pathlen ? pathlen + 1 : 0;
info->name.path = base;
info->name.sha1 = (void *)(base + pathlen + 1);
+ if (pathlen)
+ info->prev = &dummy;
}
char *make_traverse_path(char *path, const struct traverse_info *info, const struct name_entry *n)