3 # Recursively dump all blobs in the subtree identified by ID.
19 git cat-file blob "$hash" || exit $?
22 local tree=$(git ls-tree "$hash") || exit $?
23 while read -r line; do
24 local sub_type=$(echo "$line" | cut -d' ' -f 2) || exit $?
25 local sub_hash=$(echo "$line" | cut -d' ' -f 3) || exit $?
26 sub_hash=$(echo "$sub_hash" | cut -d' ' -f 1) || exit $?
27 cat-item "$sub_hash" "$sub_type"
31 echo "Unexpected item: $type $hash" 1>&2
44 type=$(git cat-file -t "$top") || exit $?
45 cat-item "$top" "$type"