]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5550-http-fetch-dumb.sh
Merge branch 'jk/http-walker-limit-redirect' into maint
[thirdparty/git.git] / t / t5550-http-fetch-dumb.sh
index 22011f0b68870a2390710f580edec60d0d8066dd..264a1ab8b0ea794ce398d9d5c3a40adb31bd0ff9 100755 (executable)
@@ -263,15 +263,15 @@ check_language () {
                >expect
                ;;
        ?*)
-               echo "Accept-Language: $1" >expect
+               echo "=> Send header: Accept-Language: $1" >expect
                ;;
        esac &&
-       GIT_CURL_VERBOSE=1 \
+       GIT_TRACE_CURL=true \
        LANGUAGE=$2 \
        git ls-remote "$HTTPD_URL/dumb/repo.git" >output 2>&1 &&
        tr -d '\015' <output |
        sort -u |
-       sed -ne '/^Accept-Language:/ p' >actual &&
+       sed -ne '/^=> Send header: Accept-Language:/ p' >actual &&
        test_cmp expect actual
 }
 
@@ -295,8 +295,16 @@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90" \
 '
 
 test_expect_success 'git client does not send an empty Accept-Language' '
-       GIT_CURL_VERBOSE=1 LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&
-       ! grep "^Accept-Language:" stderr
+       GIT_TRACE_CURL=true LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&
+       ! grep "^=> Send header: Accept-Language:" stderr
+'
+
+test_expect_success 'remote-http complains cleanly about malformed urls' '
+       # do not actually issue "list" or other commands, as we do not
+       # want to rely on what curl would actually do with such a broken
+       # URL. This is just about making sure we do not segfault during
+       # initialization.
+       test_must_fail git remote-http http::/example.com/repo.git
 '
 
 test_expect_success 'redirects can be forbidden/allowed' '