summaryrefslogtreecommitdiffstats
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-05 23:34:59 +0100
committerJunio C Hamano <gitster@pobox.com>2020-02-05 23:34:59 +0100
commitf52ab33616ee1d241f2292f1c1e47ba84a263523 (patch)
tree16666694b7aac3118a9e6527baef10d522ad9490 /t/t5510-fetch.sh
parentMerge branch 'km/submodule-add-errmsg' (diff)
parentt5604: make hash independent (diff)
downloadgit-f52ab33616ee1d241f2292f1c1e47ba84a263523.tar.xz
git-f52ab33616ee1d241f2292f1c1e47ba84a263523.zip
Merge branch 'bc/hash-independent-tests-part-7'
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
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 5f8f1c287f..566994cede 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -11,7 +11,7 @@ D=$(pwd)
test_bundle_object_count () {
git verify-pack -v "$1" >verify.out &&
- test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l)
+ test "$2" = $(grep "^$OID_REGEX " verify.out | wc -l)
}
convert_bundle_to_pack () {
@@ -285,9 +285,10 @@ test_expect_success 'create bundle 1' '
'
test_expect_success 'header of bundle looks right' '
+ head -n 4 "$D"/bundle1 &&
head -n 1 "$D"/bundle1 | grep "^#" &&
- head -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\{40\} " &&
- head -n 3 "$D"/bundle1 | grep "^[0-9a-f]\{40\} " &&
+ head -n 2 "$D"/bundle1 | grep "^-$OID_REGEX " &&
+ head -n 3 "$D"/bundle1 | grep "^$OID_REGEX " &&
head -n 4 "$D"/bundle1 | grep "^$"
'
@@ -313,7 +314,7 @@ test_expect_success 'bundle 1 has only 3 files ' '
test_expect_success 'unbundle 2' '
cd "$D/bundle" &&
git fetch ../bundle2 master:master &&
- test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"
+ test "tip" = "$(git log -1 --pretty=oneline master | cut -d" " -f2)"
'
test_expect_success 'bundle does not prerequisite objects' '