Skip to content

Commit f52ab33

Browse files
committed
Merge branch 'bc/hash-independent-tests-part-7'
Preparation of test scripts for the day when the object names will use SHA-256 continues. * bc/hash-independent-tests-part-7: t5604: make hash independent t5601: switch into repository to hash object t5562: use $ZERO_OID t5540: make hash size independent t5537: make hash size independent t5530: compute results based on object length t5512: abstract away SHA-1-specific constants t5510: make hash size independent t5504: make hash algorithm independent t5324: make hash size independent t5319: make test work with SHA-256 t5319: change invalid offset for SHA-256 compatibility t5318: update for SHA-256 t4300: abstract away SHA-1-specific constants t4204: make hash size independent t4202: abstract away SHA-1-specific constants t4200: make hash size independent t4134: compute appropriate length constant t4066: compute index line in diffs t4054: make hash-size independent
2 parents 25794d6 + 277eb5a commit f52ab33

19 files changed

+254
-219
lines changed

t/t4054-diff-bogus-tree.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ test_description='test diff with a bogus tree containing the null sha1'
44
. ./test-lib.sh
55

66
test_expect_success 'create bogus tree' '
7+
name=$(echo $ZERO_OID | sed -e "s/00/Q/g") &&
78
bogus_tree=$(
8-
printf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" |
9+
printf "100644 fooQ$name" |
910
q_to_nul |
1011
git hash-object -w --stdin -t tree
1112
)

t/t4066-diff-emit-delay.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ test_expect_success 'set up history with a merge' '
1818
'
1919

2020
test_expect_success 'log --cc -p --stat --color-moved' '
21-
cat >expect <<-\EOF &&
21+
cat >expect <<-EOF &&
2222
commit D
2323
---
2424
D.t | 1 +
2525
1 file changed, 1 insertion(+)
2626
2727
diff --git a/D.t b/D.t
2828
new file mode 100644
29-
index 0000000..1784810
29+
index 0000000..$(git rev-parse --short D:D.t)
3030
--- /dev/null
3131
+++ b/D.t
3232
@@ -0,0 +1 @@
@@ -42,7 +42,7 @@ test_expect_success 'log --cc -p --stat --color-moved' '
4242
4343
diff --git a/C.t b/C.t
4444
new file mode 100644
45-
index 0000000..3cc58df
45+
index 0000000..$(git rev-parse --short C:C.t)
4646
--- /dev/null
4747
+++ b/C.t
4848
@@ -0,0 +1 @@
@@ -54,7 +54,7 @@ test_expect_success 'log --cc -p --stat --color-moved' '
5454
5555
diff --git a/B.t b/B.t
5656
new file mode 100644
57-
index 0000000..223b783
57+
index 0000000..$(git rev-parse --short B:B.t)
5858
--- /dev/null
5959
+++ b/B.t
6060
@@ -0,0 +1 @@
@@ -66,7 +66,7 @@ test_expect_success 'log --cc -p --stat --color-moved' '
6666
6767
diff --git a/A.t b/A.t
6868
new file mode 100644
69-
index 0000000..f70f10e
69+
index 0000000..$(git rev-parse --short A:A.t)
7070
--- /dev/null
7171
+++ b/A.t
7272
@@ -0,0 +1 @@

t/t4134-apply-submodule.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ test_description='git apply submodule tests'
88
. ./test-lib.sh
99

1010
test_expect_success setup '
11+
test_oid_init &&
1112
cat > create-sm.patch <<EOF &&
1213
diff --git a/dir/sm b/dir/sm
1314
new file mode 160000
1415
index 0000000..0123456
1516
--- /dev/null
1617
+++ b/dir/sm
1718
@@ -0,0 +1 @@
18-
+Subproject commit 0123456789abcdef0123456789abcdef01234567
19+
+Subproject commit $(test_oid numeric)
1920
EOF
2021
cat > remove-sm.patch <<EOF
2122
diff --git a/dir/sm b/dir/sm
@@ -24,7 +25,7 @@ index 0123456..0000000
2425
--- a/dir/sm
2526
+++ /dev/null
2627
@@ -1 +0,0 @@
27-
-Subproject commit 0123456789abcdef0123456789abcdef01234567
28+
-Subproject commit $(test_oid numeric)
2829
EOF
2930
'
3031

t/t4200-rerere.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ test_description='git rerere
2525
. ./test-lib.sh
2626

2727
test_expect_success 'setup' '
28+
test_oid_init &&
2829
cat >a1 <<-\EOF &&
2930
Some title
3031
==========
@@ -210,7 +211,7 @@ test_expect_success 'set up for garbage collection tests' '
210211
echo Hello >$rr/preimage &&
211212
echo World >$rr/postimage &&
212213
213-
sha2=4000000000000000000000000000000000000000 &&
214+
sha2=$(test_oid deadbeef) &&
214215
rr2=.git/rr-cache/$sha2 &&
215216
mkdir $rr2 &&
216217
echo Hello >$rr2/preimage &&

0 commit comments

Comments
 (0)