@matheusbsbs / matheus-bagliano / commits / cba472d3ad
Fork 0

t5504: make hash algorithm independent

Instead of hard-coding invalid object IDs in this test, use test_oid to look up ones of the appropriate length. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Dec 21, 2019 at 19:49 UTC cba472d3adad06b07996c7d9df850c7e90a21ef3
1 file changed +9 -8
t/t5504-fetch-receive-strict.sh
+9 -8
@@ -4,6 +4,7 @@ test_description='fetch/receive strict mode'
4 . ./test-lib.sh
5
6 test_expect_success 'setup and inject "corrupt or missing" object' '
7 + test_oid_init &&
8 echo hello >greetings &&
9 git add greetings &&
10 git commit -m greetings &&
@@ -144,11 +145,11 @@ test_expect_success 'fsck with no skipList input' '
145
146 test_expect_success 'setup sorted and unsorted skipLists' '
147 cat >SKIP.unsorted <<-EOF &&
147 - 0000000000000000000000000000000000000004
148 - 0000000000000000000000000000000000000002
148 + $(test_oid 004)
149 + $(test_oid 002)
150 $commit
150 - 0000000000000000000000000000000000000001
151 - 0000000000000000000000000000000000000003
151 + $(test_oid 001)
152 + $(test_oid 003)
153 EOF
154 sort SKIP.unsorted >SKIP.sorted
155 '
@@ -172,14 +173,14 @@ test_expect_success 'fsck with invalid or bogus skipList input' '
173 test_expect_success 'fsck with other accepted skipList input (comments & empty lines)' '
174 cat >SKIP.with-comment <<-EOF &&
175 # Some bad commit
175 - 0000000000000000000000000000000000000001
176 + $(test_oid 001)
177 EOF
178 test_must_fail git -c fsck.skipList=SKIP.with-comment fsck 2>err-with-comment &&
179 test_i18ngrep "missingEmail" err-with-comment &&
180 cat >SKIP.with-empty-line <<-EOF &&
180 - 0000000000000000000000000000000000000001
181 + $(test_oid 001)
182
182 - 0000000000000000000000000000000000000002
183 + $(test_oid 002)
184 EOF
185 test_must_fail git -c fsck.skipList=SKIP.with-empty-line fsck 2>err-with-empty-line &&
186 test_i18ngrep "missingEmail" err-with-empty-line
@@ -204,7 +205,7 @@ test_expect_success 'fsck with exhaustive accepted skipList input (various types
205 echo " # Comment after whitespace" >>SKIP.exhaustive &&
206 echo "$commit # Our bad commit (with leading whitespace and trailing comment)" >>SKIP.exhaustive &&
207 echo "# Some bad commit (leading whitespace)" >>SKIP.exhaustive &&
207 - echo " 0000000000000000000000000000000000000001" >>SKIP.exhaustive &&
208 + echo " $(test_oid 001)" >>SKIP.exhaustive &&
209 git -c fsck.skipList=SKIP.exhaustive fsck 2>err &&
210 test_must_be_empty err
211 '