git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] t1300: add test for urlmatch with multiple wildcards

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 14, 2020, 22:59 UTC
Message-ID
<20200214225929.541306-3-sandals@crustytoothpaste.net>
In-Reply-To
<20200214225929.541306-1-sandals@crustytoothpaste.net>
From: brian m. carlson <bk2204@github.com>

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>
---
 t/t1300-config.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 983a0a1583..8b0cac80a3 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -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
 '
 
Previous: brian m. carlsonNext: brian m. carlson
Message 3 of 8 in “Wildcard matching for credentials”
  1. 0/3 Wildcard matching for credentialsbrian m. carlson, Feb 14, 2020
  2. 1/3 mailmap: add an additional email address for brian m. carlsonbrian m. carlson, Feb 14, 2020
  3. 2/3 t1300: add test for urlmatch with multiple wildcardsbrian m. carlson, Feb 14, 2020
  4. 3/3 credential: allow wildcard patterns when matching configbrian m. carlson, Feb 14, 2020
  5. Jeff KingFeb 16, 2020
  6. brian m. carlsonFeb 16, 2020
  7. Taylor BlauFeb 14, 2020
  8. brian m. carlsonFeb 15, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.