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.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index 37f7547a4c..6588ce6226 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -271,22 +271,21 @@ 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_perl/repo" main:a_branch &&
+ git -C client fetch --depth=2 "$HTTPD_URL/one_time_script/repo" main: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 "$(test_oid perl)" \
- "$(git -C "$REPO" rev-parse HEAD)" \
- "$(git -C "$REPO" rev-parse HEAD^)" \
- >"$HTTPD_ROOT_PATH/one-time-perl" &&
+ write_script "$HTTPD_ROOT_PATH/one-time-script" <<-EOF &&
+ sed "$(printf "$(test_oid perl)" "$(git -C "$REPO" rev-parse HEAD)" "$(git -C "$REPO" rev-parse HEAD^)")" "\$1"
+ EOF
test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \
- fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \
+ fetch --depth=1 "$HTTPD_URL/one_time_script/repo" \
main:a_branch &&
- # Ensure that the one-time-perl script was used.
- ! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
+ # Ensure that the one-time-script script was used.
+ ! test -e "$HTTPD_ROOT_PATH/one-time-script" &&
# Ensure that the resulting repo is consistent, despite our failure to
# fetch.