Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a test on NTFS (and probably HFS+) #151

Closed
wants to merge 1 commit into from

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 25, 2019

My colleague Jameson Miller once presented me with a nice puzzle why the test suite failed on their system.

Turns out that it is possible in PowerShell to spell the directory with a different case than on disk in cd <directory>, and subsequent calls to get the current working directory will use that case, rather than what is recorded on disk. And since case-insensitive filesystems are frowned upon in the Linux world, Git's test suite was not prepared for such a scenario.

Changes since v2:

  • Instead of writing everything into files, then editing those files, and then comparing via test_cmp, we now introduce test_cmp_fspath (as suggested by Junio).

Changes since v1:

  • The git config call is now safe-guarded with a --type=bool.
  • The git config call now actually looks at the correct config variable: core.ignoreCase ;-)

Cc: Martin Ågren martin.agren@gmail.com, brian m. carlson sandals@crustytoothpaste.net

@dscho dscho added the ready to submit Has commits that have not been submitted yet label Feb 25, 2019
@dscho
Copy link
Member Author

dscho commented Jun 8, 2019

/submit

@dscho dscho removed the ready to submit Has commits that have not been submitted yet label Jun 8, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Jun 8, 2019

Submitted as pull.151.git.gitgitgadget@gmail.com

t/t0001-init.sh Outdated Show resolved Hide resolved
t/t0001-init.sh Outdated Show resolved Hide resolved
@dscho
Copy link
Member Author

dscho commented Jun 19, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 19, 2019

Submitted as pull.151.v2.git.gitgitgadget@gmail.com

t/t0001-init.sh Outdated Show resolved Hide resolved
On a case-insensitive filesystem, such as HFS+ or NTFS, it is possible
that the idea Bash has of the current directory differs in case from
what Git thinks it is. That's totally okay, though, and we should not
expect otherwise.

On Windows, for example, when you call

	cd C:\GIT-SDK-64

in a PowerShell and there exists a directory called `C:\git-sdk-64`, the
current directory will be reported in all upper-case. Even in a Bash
that you might call from that PowerShell. Git, however, will have
normalized this via `GetFinalPathByHandle()`, and the expectation in
t0001 that the recorded gitdir will match what `pwd` says will be
violated.

Let's address this by comparing these paths in a case-insensitive
manner when `core.ignoreCase` is `true`.

Reported by Jameson Miller.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Jun 24, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 24, 2019

Submitted as pull.151.v3.git.gitgitgadget@gmail.com

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 24, 2019

This branch is now known as js/t0001-case-insensitive.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 24, 2019

This patch series was integrated into pu via git@cf51456.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 25, 2019

This patch series was integrated into pu via git@29fa1b9.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 26, 2019

This patch series was integrated into pu via git@7e461a9.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 27, 2019

This patch series was integrated into pu via git@f43e0d1.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 28, 2019

This patch series was integrated into pu via git@9153f47.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 28, 2019

This patch series was integrated into pu via git@2fa1cdf.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 28, 2019

This patch series was integrated into next via git@6c0001a.

@gitgitgadget gitgitgadget bot added the next label Jun 28, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Jun 28, 2019

This patch series was integrated into pu via git@e3a0a3e.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 1, 2019

This patch series was integrated into pu via git@52e197a.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 2, 2019

This patch series was integrated into pu via git@e59ff88.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 3, 2019

This patch series was integrated into pu via git@dd7c0b9.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 3, 2019

This patch series was integrated into pu via git@cf538f5.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 9, 2019

This patch series was integrated into pu via git@7a65961.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 10, 2019

This patch series was integrated into pu via git@bf8126f.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 10, 2019

This patch series was integrated into next via git@bf8126f.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 10, 2019

This patch series was integrated into master via git@bf8126f.

@gitgitgadget gitgitgadget bot added the master label Jul 10, 2019
@gitgitgadget gitgitgadget bot closed this Jul 10, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Jul 10, 2019

Closed via bf8126f.

@dscho dscho deleted the funny-cased-cwd branch July 11, 2019 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant