t5551: test server-side ERR packet
[gitweb.git] / t / t5551-http-fetch-smart.sh
index 3dc8f8ecec2c03c63788bc5b0e9db88e55deb823..ba83e567e5ca49c1664fe13f447e2744d55bfb3a 100755 (executable)
@@ -381,6 +381,21 @@ test_expect_success 'using fetch command in remote-curl updates refs' '
        test_cmp expect actual
 '
 
+test_expect_success 'fetch by SHA-1 without tag following' '
+       SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
+       rm -rf "$SERVER" client &&
+
+       git init "$SERVER" &&
+       test_commit -C "$SERVER" foo &&
+
+       git clone $HTTPD_URL/smart/server client &&
+
+       test_commit -C "$SERVER" bar &&
+       git -C "$SERVER" rev-parse bar >bar_hash &&
+       git -C client -c protocol.version=0 fetch \
+               --no-tags origin $(cat bar_hash)
+'
+
 test_expect_success 'GIT_REDACT_COOKIES redacts cookies' '
        rm -rf clone &&
        echo "Set-Cookie: Foo=1" >cookies &&
@@ -414,5 +429,10 @@ test_expect_success 'GIT_TRACE_CURL_NO_DATA prevents data from being traced' '
        ! grep "=> Send data" err
 '
 
+test_expect_success 'server-side error detected' '
+       test_must_fail git clone $HTTPD_URL/error_smart/repo.git 2>actual &&
+       grep "server-side error" actual
+'
+
 stop_httpd
 test_done