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

[PATCH v2 1/2] t3103: demonstrate dir.c:treat_one_path() core.ignorecase failure

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 23, 2013, 20:29 UTC
Message-ID
<1377289759-46838-2-git-send-email-sunshine@sunshineco.com>
In-Reply-To
<1377289759-46838-1-git-send-email-sunshine@sunshineco.com>

2eac2a4cc4bdc8d7 (ls-files -k: a directory only can be killed if the index has a non-directory; 2013-08-15) adds a caller of directory_exists_in_index(dirname,len) which forgets to satisfy the undocumented requirement that a '/' must be present at dirname[len] (despite being past the end-of-string). This oversight leads to incorrect behavior when core.ignorecase is true. Demonstrate this.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
 t/t3010-ls-files-killed-modified.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh
index 3120efd..198d308 100755
--- a/t/t3010-ls-files-killed-modified.sh
+++ b/t/t3010-ls-files-killed-modified.sh
@@ -103,6 +103,14 @@ test_expect_success 'validate git ls-files -k output.' '
 	test_cmp .expected .output
 '
 
+test_expect_success 'git ls-files -k to show killed files (icase).' '
+	git -c core.ignorecase=true ls-files -k >.output
+'
+
+test_expect_failure 'validate git ls-files -k output (icase).' '
+	test_cmp .expected .output
+'
+
 test_expect_success 'git ls-files -m to show modified files.' '
 	git ls-files -m >.output
 '
-- 
1.8.4.rc4.557.g46c5bb2
Previous: Eric SunshineNext: Eric Sunshine
Message 2 of 5 in “fix t3010 failure when core.ignorecase=true”
  1. 0/2 fix t3010 failure when core.ignorecase=trueEric Sunshine, Aug 23, 2013
  2. 1/2 t3103: demonstrate dir.c:treat_one_path() core.ignorecase failureEric Sunshine, Aug 23, 2013
  3. 2/2 dir: fix core.ignorecase inconsistency with missing '/'Eric Sunshine, Aug 23, 2013
  4. Junio C HamanoAug 23, 2013
  5. Eric SunshineAug 23, 2013

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.