From ea03ac427991683c7c89f301f97acf9627bc961c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 30 Oct 2026 10:05:03 -0700 Subject: Tidy up after a directory chain however it ends A row whose first entry is itself a directory leaked that entry's name. A level git could not read as a tree returned early instead, which also left the row's log, stats and plain links on the deeper path. --- source/ui-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/ui-tree.c') diff --git a/source/ui-tree.c b/source/ui-tree.c index 95ff337..43de1bf 100644 --- a/source/ui-tree.c +++ b/source/ui-tree.c @@ -254,7 +254,7 @@ static void print_dir_chain(const struct object_id *oid, char *name, char *rev, tree = lookup_tree(the_repository, &child.oid); if (!tree) - return; + break; free(child.name); child.name = NULL; @@ -270,6 +270,7 @@ static void print_dir_chain(const struct object_id *oid, char *name, char *rev, name = child.name; } + free(child.name); strbuf_setlen(fullpath, initial_length); } -- cgit 2.12.1