]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5601: mark protocol v2-only test
authorJonathan Tan <jonathantanmy@google.com>
Tue, 4 May 2021 22:34:55 +0000 (15:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 May 2021 01:54:41 +0000 (10:54 +0900)
A HTTP-clone test introduced in 4fe788b1b0 ("builtin/clone.c: add
--reject-shallow option", 2021-04-01) only works in protocol v2, but is
not marked as such.

The aforementioned patch implements --reject-shallow for a variety of
situations, but usage of a protocol that requires a remote helper is not
one of them. (Such an implementation would require extending the remote
helper protocol to support the passing of a "reject shallow" option, and
then teaching it to both protocol-speaking ends.)

For now, to make it pass when GIT_TEST_PROTOCOL_VERSION=0 is passed, add
"-c protocol.version=2". A more complete solution would be either to
augment the remote helper protocol to support this feature or to return
a fatal error when using --reject-shallow with a protocol that uses a
remote helper.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5601-clone.sh

index 329ae599fd3c629b3ff354d6058fbb22b219c9d7..c0688467e7c09935952d9a068d40be1c01efb212 100755 (executable)
@@ -762,7 +762,7 @@ test_expect_success 'partial clone using HTTP' '
 test_expect_success 'reject cloning shallow repository using HTTP' '
        test_when_finished "rm -rf repo" &&
        git clone --bare --no-local --depth=1 src "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-       test_must_fail git clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&
+       test_must_fail git -c protocol.version=2 clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&
        test_i18ngrep -e "source repository is shallow, reject to clone." err &&
 
        git clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo