@@ -51,8 +51,9 @@ setup() {
5151 EXPECTED_URL=" $NATIVE_LOCAL_URL "
5252 fi
5353
54- # Ensure `cygpath` is always available if we need it .
54+ # Ensure `cygpath` and `git` are always available if we need them .
5555 create_forwarding_script ' cygpath'
56+ create_forwarding_script ' git'
5657
5758 mkdir -p " $TEST_GO_ROOTDIR "
5859 cp " $_GO_CORE_DIR /go-template" " $TEST_GO_ROOTDIR "
@@ -88,7 +89,7 @@ git_for_windows_native_path() {
8889 local path=" $1 "
8990 local protocol=" ${path%%://* } "
9091
91- if [[ ! " $EXEPATH " =~ \\ Git$ ]] ||
92+ if [[ ! " $( git --version ) " =~ windows ]] ||
9293 [[ " $protocol " != " $path " && " $protocol " != ' file' ]]; then
9394 printf ' %s' " $path "
9495 elif [[ " $protocol " == ' file' ]]; then
@@ -324,7 +325,6 @@ run_with_download_program() {
324325}
325326
326327@test " $SUITE : fail to find download program uses git clone" {
327- create_forwarding_script ' git'
328328 PATH=" $BATS_TEST_BINDIR " run " $BASH " " $TEST_GO_ROOTDIR /go-template"
329329
330330 assert_output_matches " Failed to find cURL, wget, or fetch"
@@ -336,7 +336,6 @@ run_with_download_program() {
336336
337337@test " $SUITE : fail to find tar uses git clone" {
338338 create_forwarding_script ' curl'
339- create_forwarding_script ' git'
340339 PATH=" $BATS_TEST_BINDIR " run " $BASH " " $TEST_GO_ROOTDIR /go-template"
341340
342341 assert_output_matches " Failed to find tar"
0 commit comments