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() {
2525 # Read blobs/tree information from root tree
2626 git ls-tree $tree |
2727 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.*");
3131
32- # Get the blob data
32+ # Get the blob data
3333 git cat-file -e $hash ;
3434 # Ignore invalid git objects (e.g. ones that are missing)
3535 if [ $? -ne 0 ]; then
You can’t perform that action at this time.
0 commit comments