Skip to content

Commit

Permalink
Merge branch 'bc/hash-independent-tests-part-7'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Feb 5, 2020
2 parents 25794d6 + 277eb5a commit f52ab33
Show file tree
Hide file tree
Showing 19 changed files with 254 additions and 219 deletions.
3 changes: 2 additions & 1 deletion t/t4054-diff-bogus-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ test_description='test diff with a bogus tree containing the null sha1'
. ./test-lib.sh

test_expect_success 'create bogus tree' '
name=$(echo $ZERO_OID | sed -e "s/00/Q/g") &&
bogus_tree=$(
printf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" |
printf "100644 fooQ$name" |
q_to_nul |
git hash-object -w --stdin -t tree
)
Expand Down
10 changes: 5 additions & 5 deletions t/t4066-diff-emit-delay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ test_expect_success 'set up history with a merge' '
'

test_expect_success 'log --cc -p --stat --color-moved' '
cat >expect <<-\EOF &&
cat >expect <<-EOF &&
commit D
---
D.t | 1 +
1 file changed, 1 insertion(+)
diff --git a/D.t b/D.t
new file mode 100644
index 0000000..1784810
index 0000000..$(git rev-parse --short D:D.t)
--- /dev/null
+++ b/D.t
@@ -0,0 +1 @@
Expand All @@ -42,7 +42,7 @@ test_expect_success 'log --cc -p --stat --color-moved' '
diff --git a/C.t b/C.t
new file mode 100644
index 0000000..3cc58df
index 0000000..$(git rev-parse --short C:C.t)
--- /dev/null
+++ b/C.t
@@ -0,0 +1 @@
Expand All @@ -54,7 +54,7 @@ test_expect_success 'log --cc -p --stat --color-moved' '
diff --git a/B.t b/B.t
new file mode 100644
index 0000000..223b783
index 0000000..$(git rev-parse --short B:B.t)
--- /dev/null
+++ b/B.t
@@ -0,0 +1 @@
Expand All @@ -66,7 +66,7 @@ test_expect_success 'log --cc -p --stat --color-moved' '
diff --git a/A.t b/A.t
new file mode 100644
index 0000000..f70f10e
index 0000000..$(git rev-parse --short A:A.t)
--- /dev/null
+++ b/A.t
@@ -0,0 +1 @@
Expand Down
5 changes: 3 additions & 2 deletions t/t4134-apply-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ test_description='git apply submodule tests'
. ./test-lib.sh

test_expect_success setup '
test_oid_init &&
cat > create-sm.patch <<EOF &&
diff --git a/dir/sm b/dir/sm
new file mode 160000
index 0000000..0123456
--- /dev/null
+++ b/dir/sm
@@ -0,0 +1 @@
+Subproject commit 0123456789abcdef0123456789abcdef01234567
+Subproject commit $(test_oid numeric)
EOF
cat > remove-sm.patch <<EOF
diff --git a/dir/sm b/dir/sm
Expand All @@ -24,7 +25,7 @@ index 0123456..0000000
--- a/dir/sm
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 0123456789abcdef0123456789abcdef01234567
-Subproject commit $(test_oid numeric)
EOF
'

Expand Down
3 changes: 2 additions & 1 deletion t/t4200-rerere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ test_description='git rerere
. ./test-lib.sh

test_expect_success 'setup' '
test_oid_init &&
cat >a1 <<-\EOF &&
Some title
==========
Expand Down Expand Up @@ -210,7 +211,7 @@ test_expect_success 'set up for garbage collection tests' '
echo Hello >$rr/preimage &&
echo World >$rr/postimage &&
sha2=4000000000000000000000000000000000000000 &&
sha2=$(test_oid deadbeef) &&
rr2=.git/rr-cache/$sha2 &&
mkdir $rr2 &&
echo Hello >$rr2/preimage &&
Expand Down
Loading

0 comments on commit f52ab33

Please sign in to comment.