summaryrefslogtreecommitdiff
path: root/t/t5537-fetch-shallow.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5537-fetch-shallow.sh')
-rwxr-xr-xt/t5537-fetch-shallow.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index 66f0b64d39..b57209c84f 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -15,7 +15,11 @@ test_expect_success 'setup' '
commit 2 &&
commit 3 &&
commit 4 &&
- git config --global transfer.fsckObjects true
+ git config --global transfer.fsckObjects true &&
+ test_oid_cache <<-EOF
+ perl sha1:s/0034shallow %s/0036unshallow %s/
+ perl sha256:s/004cshallow %s/004eunshallow %s/
+ EOF
'
test_expect_success 'setup shallow clone' '
@@ -127,7 +131,7 @@ test_expect_success 'fetch that requires changes in .git/shallow is filtered' '
git init notshallow &&
(
cd notshallow &&
- git fetch ../shallow/.git refs/heads/*:refs/remotes/shallow/*&&
+ git fetch ../shallow/.git refs/heads/*:refs/remotes/shallow/* &&
git for-each-ref --format="%(refname)" >actual.refs &&
cat <<EOF >expect.refs &&
refs/remotes/shallow/no-shallow
@@ -233,26 +237,29 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
git -C "$REPO" config protocol.version 2 &&
git -C client config protocol.version 2 &&
- git -C client fetch --depth=2 "$HTTPD_URL/one_time_sed/repo" master:a_branch &&
+ git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" master:a_branch &&
# Craft a situation in which the server sends back an unshallow request
# with an empty packfile. This is done by refetching with a shorter
# depth (to ensure that the packfile is empty), and overwriting the
# shallow line in the response with the unshallow line we want.
- printf "s/0034shallow %s/0036unshallow %s/" \
+ printf "$(test_oid perl)" \
"$(git -C "$REPO" rev-parse HEAD)" \
"$(git -C "$REPO" rev-parse HEAD^)" \
- >"$HTTPD_ROOT_PATH/one-time-sed" &&
+ >"$HTTPD_ROOT_PATH/one-time-perl" &&
test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \
- fetch --depth=1 "$HTTPD_URL/one_time_sed/repo" \
+ fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \
master:a_branch &&
- # Ensure that the one-time-sed script was used.
- ! test -e "$HTTPD_ROOT_PATH/one-time-sed" &&
+ # Ensure that the one-time-perl script was used.
+ ! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
# Ensure that the resulting repo is consistent, despite our failure to
# fetch.
git -C client fsck
'
+# DO NOT add non-httpd-specific tests here, because the last part of this
+# test script is only executed when httpd is available and enabled.
+
test_done