From b94bde1b3cb7725e41eb61efbac891fafa9c90d9 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:15:47 -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') 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.11.1