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

Re: Possible minor bug in Git

From
Torsten Bögershausen <tboegi@web.de>
Date
Feb 8, 2019, 17:43 UTC
Message-ID
<20190208174315.nnljdpbh4nyoxgd7@tb-raspi4>
In-Reply-To
<nycvar.QRO.7.76.6.1902072040360.41@tvgsbejvaqbjf.bet>
On Fri, Feb 08, 2019 at 04:18:23PM +0100, Giuseppe Crinò wrote:
Show 23 quoted lines
> OK, I successfully built git on Windows (thanks Johannes!) and I'm now able to run it.
>
> As of 9f16cdd I can successfully reproduce the bug.
>
> Interestingly enough, I can reproduce the bug even for /usr/bin/git running inside Windows Subsystem for Linux. Part of the reason might be that both relies on the same lstat() call... (Note: `stat` inside the WSL is case _insensitive_).
>
> Now: what is the expected result for git running inside Windows? Should it die saying "fatal: pathspec ... did not match any files"?
>
> If that's the case, is the following a valid test case?
>
> 	diff --git a/t/t3700-add.sh b/t/t3700-add.sh
> 	index 8ee4fc70ad..fadd7c74f6 100755
> 	--- a/t/t3700-add.sh
> 	+++ b/t/t3700-add.sh
> 	@@ -61,6 +61,11 @@ test_expect_success 'git add: filemode=0 should not get confused by symlink' '
> 		test_mode_in_index 120000 xfoo2
> 	 '
>
> 	+test_expect_success 'git add: pathspec is case-sensitive' '
> 	+       echo new > file &&
> 	+       test_must_fail git add File
> 	+'
> 	+

In general, yes. There are 2 comments: This the "echo" line should have no ' ' after the '>':

	echo new >file &&

The other question is, if we should move that test case into t0050-filesystem.sh, but that is a matter of taste.

diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 192c94eccd..b8d6bad97a 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -106,6 +106,11 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
        test "z$(git cat-file blob :$camel)" = z1
	 '

+test_expect_success CASE_INSENSITIVE_FS 'add (with wrong case)' '
+       git reset --hard initial &&
+       test_must_fail git add CAMELCASE
+'
+
Previous: Johannes SchindelinNext: Philip Oakley
Message 8 of 10 in “Possible minor bug in Git”
  1. Angelo MelonasJan 31, 2019
  2. Angelo MelonasJan 31, 2019
  3. Torsten BögershausenJan 31, 2019
  4. Angelo MelonasFeb 1, 2019
  5. Torsten BögershausenFeb 2, 2019
  6. Giuseppe CrinòFeb 6, 2019
  7. Johannes SchindelinFeb 7, 2019
  8. Torsten BögershausenFeb 8, 2019
  9. Philip OakleyFeb 9, 2019
  10. Giuseppe Crino'Feb 10, 2019

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.