chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d806e89
)
git-debrebase: get_tree: Support '' for nonexistent objects
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 16:47:39 +0000
(17:47 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 16:47:39 +0000
(17:47 +0100)
This is going to be convenient in a moment.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase
patch
|
blob
|
history
diff --git
a/git-debrebase
b/git-debrebase
index 8fa5adb73b34f29054f4bd043551e3143f1a724a..57bfa9829ee3e1e5878d3c160756dced551cb281 100755
(executable)
--- a/
git-debrebase
+++ b/
git-debrebase
@@
-187,8
+187,12
@@
sub get_tree ($) {
# 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;