Re: Case sensitivity on Windows for absolute paths.
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Apr 23, 2010, 19:46 UTC
- Message-ID
- <201004232146.56424.j6t@kdbg.org>
- In-Reply-To
- <o2v7eeb06461004230712i2c8c1e61l4c50a73a4f6c83d@mail.gmail.com>
On Freitag, 23. April 2010, Ricky Clarkson wrote:
Show 6 quoted lines
> I noticed that if I have a git repository at C:\foo, and there is a > file in there named bar, git add bar works fine, git add C:\foo/bar > works fine but git add c:\foo/bar does not. git reports that the file > 'is outside repository'. Looking at setup.c it seems that string > comparisons are being used to determine whether a file is within the > repository.
Yes, we should be a bit more liberal when drive letters are compared; they should be treated in a case-insensitive manner, but currently we are strict.
> For my purposes I can probably make a Windows build that does it while > ignoring the case, but is there a more proper way that git should do > it? I'm not familiar enough with the POSIX file routines to know.
My guess is that it is sufficient that
1. the internal version of GIT_DIR is recorded with an uppercase drive letter;
2. normalize_path_copy() upper-cases the drive letter.
Then the comparison in prefix_path() should do the right thing.
-- Hannes