]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1300: add test for urlmatch with multiple wildcards
authorbrian m. carlson <bk2204@github.com>
Thu, 20 Feb 2020 02:24:10 +0000 (02:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Feb 2020 21:05:43 +0000 (13:05 -0800)
Our urlmatch code handles multiple wildcards, but we don't currently
have a test that checks this code path. Add a test that we handle this
case correctly to avoid any regressions.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1300-config.sh

index 983a0a15839acf90aefec0a78d9ee1574dc7c445..8b0cac80a3c2a552e9461b6906aa92168888e821 100755 (executable)
@@ -1408,6 +1408,8 @@ test_expect_success 'urlmatch favors more specific URLs' '
                cookieFile = /tmp/wildcard.txt
        [http "https://*.example.com/wildcardwithsubdomain"]
                cookieFile = /tmp/wildcardwithsubdomain.txt
+       [http "https://*.example.*"]
+               cookieFile = /tmp/multiwildcard.txt
        [http "https://trailing.example.com"]
                cookieFile = /tmp/trailing.txt
        [http "https://user@*.example.com/"]
@@ -1454,6 +1456,10 @@ test_expect_success 'urlmatch favors more specific URLs' '
 
        echo http.cookiefile /tmp/sub.txt >expect &&
        git config --get-urlmatch HTTP https://user@sub.example.com >actual &&
+       test_cmp expect actual &&
+
+       echo http.cookiefile /tmp/multiwildcard.txt >expect &&
+       git config --get-urlmatch HTTP https://wildcard.example.org >actual &&
        test_cmp expect actual
 '