summaryrefslogtreecommitdiff
path: root/t/t5703-upload-pack-ref-in-want.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-02-07 00:52:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-07 19:07:31 (GMT)
commitd341e0805d91b4575ed3426be8e8bcb44744846c (patch)
treebc35e723adc11593c7584e67e6950a40bf30c79e /t/t5703-upload-pack-ref-in-want.sh
parent88ed241a7eff7699a21c6868ef0682879f8a0dec (diff)
downloadgit-d341e0805d91b4575ed3426be8e8bcb44744846c.zip
git-d341e0805d91b4575ed3426be8e8bcb44744846c.tar.gz
git-d341e0805d91b4575ed3426be8e8bcb44744846c.tar.bz2
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>
Diffstat (limited to 't/t5703-upload-pack-ref-in-want.sh')
-rwxr-xr-xt/t5703-upload-pack-ref-in-want.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 1424fab..8aeeaac 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -19,7 +19,7 @@ get_actual_commits () {
}' <out | test-tool pkt-line unpack-sideband >o.pack &&
git index-pack o.pack &&
git verify-pack -v o.idx >objs &&
- grep commit objs | cut -c-40 | sort >actual_commits
+ grep commit objs | cut -d" " -f1 | sort >actual_commits
}
check_output () {
@@ -37,6 +37,7 @@ check_output () {
# \ | /
# a
test_expect_success 'setup repository' '
+ test_oid_init &&
test_commit a &&
git checkout -b o/foo &&
test_commit b &&
@@ -333,7 +334,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant false &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- inconsistency master 1234567890123456789012345678901234567890 &&
+ inconsistency master $(test_oid numeric) &&
test_must_fail git -C local fetch 2>err &&
test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
'
@@ -342,7 +343,7 @@ test_expect_success 'server is initially ahead - ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant true &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- inconsistency master 1234567890123456789012345678901234567890 &&
+ inconsistency master $(test_oid numeric) &&
git -C local fetch &&
git -C "$REPO" rev-parse --verify master >expected &&