]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5601-clone.sh
builtin/clone.c: add --reject-shallow option
[thirdparty/git.git] / t / t5601-clone.sh
index e7e6c089554c5d2b0ba7cd51b79a53f6880f0ae1..329ae599fd3c629b3ff354d6058fbb22b219c9d7 100755 (executable)
@@ -759,6 +759,15 @@ test_expect_success 'partial clone using HTTP' '
        partial_clone "$HTTPD_DOCUMENT_ROOT_PATH/server" "$HTTPD_URL/smart/server"
 '
 
+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_i18ngrep -e "source repository is shallow, reject to clone." err &&
+
+       git clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo
+'
+
 # 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.