diff options
Diffstat (limited to 'read_object.pl')
-rwxr-xr-x | read_object.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/read_object.pl b/read_object.pl index 10a4e56..40013d4 100755 --- a/read_object.pl +++ b/read_object.pl @@ -107,6 +107,10 @@ sub format_tree { my @rc = (); while (@tree) { my ($info, $id) = (shift @tree, shift @tree); + unless ($id || @tree) { + $id = substr($info, -20); + $info = substr($info, 0, -21); + } $info =~ /^([^ ]*) (.*)/; my ($mode, $name) = ($1, $2); my @bytes = unpack('C*', $id); |