public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
To: git@vger.kernel.org
Cc: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Subject: [PATCH] t1091: cone mode list deduplicates and normalizes paths
Date: Mon, 19 Jan 2026 16:57:26 +0000	[thread overview]
Message-ID: <20260119165724.7339-3-pushkarkumarsingh1970@gmail.com> (raw)

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


             reply	other threads:[~2026-01-19 17:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 16:57 Pushkar Singh [this message]
2026-01-19 18:11 ` [PATCH] t1091: cone mode list deduplicates and normalizes paths Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260119165724.7339-3-pushkarkumarsingh1970@gmail.com \
    --to=pushkarkumarsingh1970@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox