Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorBen Peart <Ben.Peart@microsoft.com>2018-07-12 18:44:36 +0300
committerJunio C Hamano <gitster@pobox.com>2018-07-12 22:11:05 +0300
commit5a06a20e0c8820fb0ca8da019c7a9fe6eb30ec2f (patch)
tree4c3f1295e943f24300e95e59078191cd57e6a387 /t/helper
parent53f9a3e157dbbc901a02ac2c73346d375e24978c (diff)
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>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-drop-caches.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
index d6bcfddf13..f65e301f9d 100644
--- a/t/helper/test-drop-caches.c
+++ b/t/helper/test-drop-caches.c
@@ -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,