Re: Possible minor bug in Git
- Date: Fri, 8 Feb 2019 17:43:16 +0000
- From: Torsten Bögershausen <tboegi@xxxxxx>
- Subject: Re: Possible minor bug in Git
On Fri, Feb 08, 2019 at 04:18:23PM +0100, Giuseppe Crinò wrote:
> 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
@@ -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