summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-12-31 08:07:51 +0100
committerSebastian Thiel <sebastian.thiel@icloud.com>2022-12-31 09:26:44 +0100
commitfbc36f9cefa3a7e150187dabf8758a53062c5b47 (patch)
tree1476ec8a6cdfa5e531db066ff2e7fea88cad925e
parent44636240a08bba4a13355a5a23543d537ff15576 (diff)
downloadgitpython-fbc36f9cefa3a7e150187dabf8758a53062c5b47.tar.gz
tests: Use `command -v` instead of third-party `which` program
Use `command -v` to locate the git executable instead of `which`. The former is guaranteed to always be available according to POSIX, while which(1) is a redundant third-party tool that is slowly being phased out from Linux distributions. In particular, Gentoo no longer installs it by default.
-rw-r--r--test/test_git.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_git.py b/test/test_git.py
index e7d236de..c5d871f0 100644
--- a/test/test_git.py
+++ b/test/test_git.py
@@ -169,7 +169,7 @@ class TestGit(TestBase):
self.assertRaises(GitCommandNotFound, refresh, "yada")
# test a good path refresh
- which_cmd = "where" if is_win else "which"
+ which_cmd = "where" if is_win else "command -v"
path = os.popen("{0} git".format(which_cmd)).read().strip().split("\n")[0]
refresh(path)