mirror of
https://github.com/git/git
synced 2024-10-01 06:05:20 +00:00
cache-tree.c::cache_tree_find(): simplify internal API
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>
This commit is contained in:
parent
d11b8d3425
commit
b87fc96476
|
@ -514,6 +514,8 @@ struct cache_tree *cache_tree_read(const char *buffer, unsigned long size)
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue