chiark / gitweb /
git-debrebase: get_tree: Check we got an object name
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 19:56:24 +0000 (20:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 20:14:39 +0000 (21:14 +0100)
Otherwise the cache is dangerous.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 3be444b..165dc66 100755 (executable)
@@ -196,6 +196,8 @@ sub get_tree ($;$$) {
        return () if $type eq 'missing';
     }
 
+    confess "get_tree needs object not $x ?" unless $x =~ m{^[0-9a-f]+\:};
+
     our (@get_tree_memo, %get_tree_memo);
     my $memo = $get_tree_memo{$x};
     return @$memo if $memo;