Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-12-21 22:49:29 +0300
committerJunio C Hamano <gitster@pobox.com>2020-01-16 01:06:19 +0300
commitba1be1ab45801db55e5b9e66194a82ffcc76b5f0 (patch)
tree79fe9f2f700ca4ec17d3a91a803b187206fa4470 /t/t5510-fetch.sh
parentcba472d3adad06b07996c7d9df850c7e90a21ef3 (diff)
t5510: make hash size independent
Use $OID_REGEX instead of hard-coding 40-based regular expressions. Change invocations of cut with a hard-coded constant to split using a delimiter instead. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 4b60282689..2ceae14164 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 () {
@@ -261,9 +261,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 "^$"
'
@@ -289,7 +290,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' '