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

[PATCH] t1091: cone mode list deduplicates and normalizes paths

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Jan 19, 2026, 16:57 UTC
Message-ID
<20260119165724.7339-3-pushkarkumarsingh1970@gmail.com>

Ensure that git sparse-checkout list in cone mode collapses semantically identical paths (e.g. "folder1", "folder1/", and "./folder1") into a single canonical entry.

This protects user-visible behavior across different ways of specifying sparse-checkout patterns.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
---
 t/t1091-sparse-checkout-builtin.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index b2da4feaef..d4ed215aa5 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -321,6 +321,21 @@ test_expect_success 'cone mode: list' '
 	test_cmp expect actual
 '
 
+test_expect_success 'cone mode: list deduplicates and normalizes paths' '
+	git -C repo sparse-checkout disable &&
+	rm -f repo/.git/info/sparse-checkout &&
+	git -C repo sparse-checkout init --cone &&
+
+	printf "folder1\nfolder1/\n./folder1\n" |
+		git -C repo sparse-checkout set --stdin &&
+
+	git -C repo sparse-checkout list >actual &&
+	cat >expect <<-\EOF &&
+	folder1
+	EOF
+	test_cmp expect actual
+'
+
 test_expect_success 'cone mode: set with nested folders' '
 	git -C repo sparse-checkout set deep deep/deeper1/deepest 2>err &&
 	test_line_count = 0 err &&
-- 
2.43.0
Next: Derrick Stolee
Message 1 of 2 in “t1091: cone mode list deduplicates and normalizes paths”
  1. t1091: cone mode list deduplicates and normalizes pathsPushkar Singh, Jan 19, 2026
  2. Derrick StoleeJan 19, 2026

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.