summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d11b8d3)
raw | patch | inline | side by side (parent: d11b8d3)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 20 May 2009 22:53:57 +0000 (15:53 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 25 May 2009 18:35:19 +0000 (11:35 -0700) |
Earlier cache_tree_find() needs to be called with a valid cache_tree,
but repeated look-up may find an invalid or missing cache_tree in between.
Help simplify the callers by returning NULL to mean "nothing appropriate
found" when the input is NULL.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
but repeated look-up may find an invalid or missing cache_tree in between.
Help simplify the callers by returning NULL to mean "nothing appropriate
found" when the input is NULL.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c | patch | blob | history |
diff --git a/cache-tree.c b/cache-tree.c
index 6dd8411945c77568373e8a354b925926952f147c..5481e43340a1590f759cfacc954f4331216d67b5 100644 (file)
--- a/cache-tree.c
+++ b/cache-tree.c
static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *path)
{
+ if (!it)
+ return NULL;
while (*path) {
const char *slash;
struct cache_tree_sub *sub;