From 1fff303fc2b31d5005f38f55f38c4e8521da5a93 Mon Sep 17 00:00:00 2001 From: Ben Peart Date: Fri, 10 Nov 2017 16:03:11 -0500 Subject: fsmonitor: simplify determining the git worktree under Windows Simplify and speed up the process of finding the git worktree when running on Windows by keeping it in perl and avoiding spawning helper processes. Signed-off-by: Ben Peart Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t7519/fsmonitor-watchman | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 't/t7519') diff --git a/t/t7519/fsmonitor-watchman b/t/t7519/fsmonitor-watchman index 5fe72cefaf..5514edcf68 100755 --- a/t/t7519/fsmonitor-watchman +++ b/t/t7519/fsmonitor-watchman @@ -29,17 +29,10 @@ if ($version == 1) { "Falling back to scanning...\n"; } -# Convert unix style paths to escaped Windows style paths when running -# in Windows command prompt - -my $system = `uname -s`; -$system =~ s/[\r\n]+//g; my $git_work_tree; - -if ($system =~ m/^MSYS_NT/ || $system =~ m/^MINGW/) { - $git_work_tree = `cygpath -aw "\$PWD"`; - $git_work_tree =~ s/[\r\n]+//g; - $git_work_tree =~ s,\\,/,g; +if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $git_work_tree = Win32::GetCwd(); + $git_work_tree =~ tr/\\/\//; } else { require Cwd; $git_work_tree = Cwd::cwd(); -- cgit v1.2.3