fsmonitor: MINGW support for watchman integration
authorBen Peart <benpeart@microsoft.com>
Wed, 4 Oct 2017 02:09:50 +0000 (11:09 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Oct 2017 02:10:24 +0000 (11:10 +0900)
Instead of just taking $ENV{'PWD'}, use the same logic that converts
PWD to $git_work_tree on MSYS_NT in the watchman integration hook
script also on MINGW.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7519/fsmonitor-watchman
templates/hooks--fsmonitor-watchman.sample

index 7ceb32d..cca3d71 100755 (executable)
@@ -36,7 +36,7 @@ my $system = `uname -s`;
 $system =~ s/[\r\n]+//g;
 my $git_work_tree;
 
-if ($system =~ m/^MSYS_NT/) {
+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;
index 870a59d..c68038e 100755 (executable)
@@ -35,7 +35,7 @@ my $system = `uname -s`;
 $system =~ s/[\r\n]+//g;
 my $git_work_tree;
 
-if ($system =~ m/^MSYS_NT/) {
+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;