Skip to content

Commit b4459ca

Browse files
committed
BF(WIN): use where instead of which while looking for git
1 parent 91b9bc4 commit b4459ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: git/test/test_git.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
except ImportError:
3838
import mock
3939

40+
from git.compat import is_win
41+
4042

4143
class TestGit(TestBase):
4244

@@ -177,7 +179,8 @@ def test_refresh(self):
177179
self.assertRaises(GitCommandNotFound, refresh, "yada")
178180

179181
# test a good path refresh
180-
path = os.popen("which git").read().strip()
182+
which_cmd = "where" if is_win else "which"
183+
path = os.popen("{0} git".format(which_cmd)).read().strip()
181184
refresh(path)
182185

183186
def test_options_are_passed_to_git(self):

0 commit comments

Comments
 (0)