File tree Expand file tree Collapse file tree 6 files changed +10
-9
lines changed Expand file tree Collapse file tree 6 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -815,7 +815,8 @@ test_expect_success 'test_oid provides sane info by default' '
815
815
grep "^00*\$" actual &&
816
816
rawsz="$(test_oid rawsz)" &&
817
817
hexsz="$(test_oid hexsz)" &&
818
- test "$hexsz" -eq $(wc -c <actual) &&
818
+ # +1 accounts for the trailing newline
819
+ test $(( $hexsz + 1)) -eq $(wc -c <actual) &&
819
820
test $(( $rawsz * 2)) -eq "$hexsz"
820
821
'
821
822
@@ -826,7 +827,7 @@ test_expect_success 'test_oid can look up data for SHA-1' '
826
827
grep "^00*\$" actual &&
827
828
rawsz="$(test_oid rawsz)" &&
828
829
hexsz="$(test_oid hexsz)" &&
829
- test $(wc -c <actual) -eq 40 &&
830
+ test $(wc -c <actual) -eq 41 &&
830
831
test "$rawsz" -eq 20 &&
831
832
test "$hexsz" -eq 40
832
833
'
@@ -838,7 +839,7 @@ test_expect_success 'test_oid can look up data for SHA-256' '
838
839
grep "^00*\$" actual &&
839
840
rawsz="$(test_oid rawsz)" &&
840
841
hexsz="$(test_oid hexsz)" &&
841
- test $(wc -c <actual) -eq 64 &&
842
+ test $(wc -c <actual) -eq 65 &&
842
843
test "$rawsz" -eq 32 &&
843
844
test "$hexsz" -eq 64
844
845
'
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ test_expect_success 'setup' '
27
27
'
28
28
29
29
test_expect_success ' gitdir selection on normal repos' '
30
- echo $( test_oid version) >expect &&
30
+ test_oid version >expect &&
31
31
git config core.repositoryformatversion >actual &&
32
32
git -C test config core.repositoryformatversion >actual2 &&
33
33
test_cmp expect actual &&
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ test_expect_success 'rev-parse --is-shallow-repository in non-shallow repo' '
195
195
'
196
196
197
197
test_expect_success ' rev-parse --show-object-format in repo' '
198
- echo "$( test_oid algo)" >expect &&
198
+ test_oid algo >expect &&
199
199
git rev-parse --show-object-format >actual &&
200
200
test_cmp expect actual &&
201
201
git rev-parse --show-object-format=storage >actual &&
Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ test_expect_success 'setup' '
34
34
100644 blob $(test_oid hash2) foo
35
35
EOF
36
36
37
- echo "$( test_oid val1)" > foo &&
37
+ test_oid val1 > foo &&
38
38
git add foo &&
39
39
git commit -m "initial" &&
40
40
git cat-file -p HEAD: > actual &&
41
41
test_cmp expect_initial actual &&
42
- echo "$( test_oid val2)" > foo &&
42
+ test_oid val2 > foo &&
43
43
git commit -a -m "update" &&
44
44
git cat-file -p HEAD: > actual &&
45
45
test_cmp expect_update actual
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ test_expect_success 'setup' '
59
59
test_expect_success ' set up base packfile and variables' '
60
60
# the hash of this content starts with ff, which
61
61
# makes some later computations much simpler
62
- echo $( test_oid oidfff) >file &&
62
+ test_oid oidfff >file &&
63
63
git add file &&
64
64
git commit -m base &&
65
65
git repack -ad &&
Original file line number Diff line number Diff line change @@ -1682,7 +1682,7 @@ test_oid () {
1682
1682
then
1683
1683
BUG " undefined key '$1 '"
1684
1684
fi &&
1685
- eval " printf '%s' \"\$ {$var }\" "
1685
+ eval " printf '%s\n ' \"\$ {$var }\" "
1686
1686
}
1687
1687
1688
1688
# Insert a slash into an object ID so it can be used to reference a location
You can’t perform that action at this time.
0 commit comments