File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ function traverse_tree() {
25
25
# Read blobs/tree information from root tree
26
26
git ls-tree $tree |
27
27
while read leaf; do
28
- type=$( echo $leaf | grep -oE " ^\d+\s+\K\w{4}" ) ;
29
- hash=$( echo $leaf | grep -oE " ^\d+\s+\w{4}\s+\K\w{40}" ) ;
30
- name=$( echo $leaf | grep -oE " ^\d+\s+\w{4}\s+\w{40}\s+\K.*" ) ;
28
+ type=$( echo $leaf | awk -F ' ' ' {print $2} ' ) # grep -oP "^\d+\s+\K\w{4}");
29
+ hash=$( echo $leaf | awk -F ' ' ' {print $3} ' ) # grep -oP "^\d+\s+\w{4}\s+\K\w{40}");
30
+ name=$( echo $leaf | awk ' {$1=$2=$3=""; print substr($0,4)} ' ) # grep -oP "^\d+\s+\w{4}\s+\w{40}\s+\K.*");
31
31
32
- # Get the blob data
32
+ # Get the blob data
33
33
git cat-file -e $hash ;
34
34
# Ignore invalid git objects (e.g. ones that are missing)
35
35
if [ $? -ne 0 ]; then
You can’t perform that action at this time.
0 commit comments