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

t5703: make test work with SHA-256

This test used an object ID which was 40 hex characters in length, causing the test not only not to pass, but to hang, when run with SHA-256 as the hash. Change this value to a fixed dummy object ID using test_oid_init and test_oid. Furthermore, ensure we extract an object ID of the appropriate length using cut with fields instead of a fixed length. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Feb 7, 2020 at 00:52 UTC d341e0805d91b4575ed3426be8e8bcb44744846c
1 file changed +4 -3
t/t5703-upload-pack-ref-in-want.sh
+4 -3
@@ -19,7 +19,7 @@ get_actual_commits () {
19 }' <out | test-tool pkt-line unpack-sideband >o.pack &&
20 git index-pack o.pack &&
21 git verify-pack -v o.idx >objs &&
22 - grep commit objs | cut -c-40 | sort >actual_commits
22 + grep commit objs | cut -d" " -f1 | sort >actual_commits
23 }
24
25 check_output () {
@@ -37,6 +37,7 @@ check_output () {
37 # \ | /
38 # a
39 test_expect_success 'setup repository' '
40 + test_oid_init &&
41 test_commit a &&
42 git checkout -b o/foo &&
43 test_commit b &&
@@ -333,7 +334,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
334 git -C "$REPO" config uploadpack.allowRefInWant false &&
335 rm -rf local &&
336 cp -r "$LOCAL_PRISTINE" local &&
336 - inconsistency master 1234567890123456789012345678901234567890 &&
337 + inconsistency master $(test_oid numeric) &&
338 test_must_fail git -C local fetch 2>err &&
339 test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
340 '
@@ -342,7 +343,7 @@ test_expect_success 'server is initially ahead - ref in want' '
343 git -C "$REPO" config uploadpack.allowRefInWant true &&
344 rm -rf local &&
345 cp -r "$LOCAL_PRISTINE" local &&
345 - inconsistency master 1234567890123456789012345678901234567890 &&
346 + inconsistency master $(test_oid numeric) &&
347 git -C local fetch &&
348
349 git -C "$REPO" rev-parse --verify master >expected &&