summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-21 02:01:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 04:55:48 (GMT)
commiteea253bf39c0a8f9995bea1a4c648829c36b79d7 (patch)
tree5ea5a5bf686d3c5065b3653042778ac33844886b
parent0b2c4af4b667165cc23330db07693865b55eb927 (diff)
downloadgit-eea253bf39c0a8f9995bea1a4c648829c36b79d7.zip
git-eea253bf39c0a8f9995bea1a4c648829c36b79d7.tar.gz
git-eea253bf39c0a8f9995bea1a4c648829c36b79d7.tar.bz2
t5300: abstract away SHA-1-specific constants
Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5300-pack-object.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 65ff60f..9e66637 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -466,9 +466,11 @@ test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'pack-objects --threads=N or pack.
test_expect_success \
'fake a SHA1 hash collision' \
- 'test -f .git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&
- cp -f .git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \
- .git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'
+ 'long_a=$(git hash-object a | sed -e "s!^..!&/!") &&
+ long_b=$(git hash-object b | sed -e "s!^..!&/!") &&
+ test -f .git/objects/$long_b &&
+ cp -f .git/objects/$long_a \
+ .git/objects/$long_b'
test_expect_success \
'make sure index-pack detects the SHA1 collision' \