# tree object name => ([ $name, $info ], ...)
# where $name is the sort key, ie has / at end for subtrees
# $info is the LHS from git-ls-tree (<mode> <type> <hash>)
- # will crash if $x does not exist, so don't do that
+ # will crash if $x does not exist, so don't do that;
+ # instead pass '' to get ().
my ($x) = @_;
+
+ return () if !length $x;
+
our (@get_tree_memo, %get_tree_memo);
my $memo = $get_tree_memo{$x};
return @$memo if $memo;