build: gen-version-i.sh: use `command` to check if git exists
[babeltrace.git] / src / common / gen-version-i.sh
index bd71919637a2cff90880007221d9027c6645a601..5131caf0975c450a4ed7ce3586a13409d0b05f18 100755 (executable)
@@ -37,7 +37,7 @@ fi
 # starts with "v" and the tree is clean, consider this a release version and
 # overwrite the git version with an empty string in "version.i.tmp".
 if test -r "$TOP_SRCDIR/bootstrap" && test -r "$TOP_SRCDIR/.git" &&
-               test -x "$(which git 2>&1; true)"; then
+               (command -v git > /dev/null 2>&1); then
        GIT_VERSION_STR="$(cd "$TOP_SRCDIR" && git describe --tags --dirty)"
        GIT_CURRENT_TAG="$(cd "$TOP_SRCDIR" && (git describe --tags --exact-match --match="v[0-9]*" HEAD || true) 2> /dev/null)"
        echo "#define BT_VERSION_GIT \"$GIT_VERSION_STR\"" > version.i.tmp
This page took 0.024671 seconds and 4 git commands to generate.