1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-09 12:56:12 +02:00

handle lower case drive letters on Windows

On Windows, if a tool calls SetCurrentDirectory with a lower case drive
letter, the subsequent call to GetCurrentDirectory will return the same
lower case drive letter. Powershell, for example, does not normalize the
path. If that happens, test-drop-caches will error out as it does not
correctly to handle lower case drive letters.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ben Peart 2018-07-12 15:44:36 +00:00 committed by Junio C Hamano
parent 53f9a3e157
commit 5a06a20e0c

View File

@ -16,8 +16,8 @@ static int cmd_sync(void)
if ((0 == dwRet) || (dwRet > MAX_PATH))
return error("Error getting current directory");
if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
return error("Invalid drive letter '%c'", Buffer[0]);
if (!has_dos_drive_prefix(Buffer))
return error("'%s': invalid drive letter", Buffer);
szVolumeAccessPath[4] = Buffer[0];
hVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,