- $root = abs_path $root unless file_name_is_absolute $root;
- return unless defined $args{git} and -x $args{git};
+ $root = File::Spec->canonpath(Cwd::abs_path($root));
+
+ my $git = $args{git};
+ return unless defined $git;
+ if (IS_WIN32) {
+ unless (-x $git) {
+ $git .= '.bat';
+ return unless -x $git;
+ }
+ } else {
+ return unless -x $git;
+ }
+ $git = File::Spec->canonpath(Cwd::abs_path($git));
+