File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -59,18 +59,25 @@ test_atom() {
5959 # Automatically test "contents:size" atom after testing "contents"
6060 if test " $2 " = " contents"
6161 then
62- case $( git cat-file -t " $ref " ) in
63- tag)
64- # We cannot use $3 as it expects sanitize_pgp to run
65- expect=$( git cat-file tag $ref | tail -n +6 | wc -c) ;;
66- tree | blob)
67- expect=' ' ;;
68- commit)
69- expect=$( printf ' %s' " $3 " | wc -c) ;;
70- esac
71- # Leave $expect unquoted to lose possible leading whitespaces
72- echo $expect > expected
62+ # for commit leg, $3 is changed there
63+ expect=$( printf ' %s' " $3 " | wc -c)
7364 test_expect_${4:- success} $PREREQ " basic atom: $1 contents:size" '
65+ type=$(git cat-file -t "$ref") &&
66+ case $type in
67+ tag)
68+ # We cannot use $3 as it expects sanitize_pgp to run
69+ git cat-file tag $ref >out &&
70+ expect=$(tail -n +6 out | wc -c) &&
71+ rm -f out ;;
72+ tree | blob)
73+ expect="" ;;
74+ commit)
75+ : "use the calculated expect" ;;
76+ *)
77+ BUG "unknown object type" ;;
78+ esac &&
79+ # Leave $expect unquoted to lose possible leading whitespaces
80+ echo $expect >expected &&
7481 git for-each-ref --format="%(contents:size)" "$ref" >actual &&
7582 test_cmp expected actual
7683 '
You can’t perform that action at this time.
0 commit comments