Use hash to check git binary
This commit is contained in:
parent
c25d668b43
commit
38a37d1bd4
|
@ -45,9 +45,13 @@ _main() {
|
|||
}
|
||||
|
||||
_check_if_git_is_available() {
|
||||
PATH_TO_GIT=$(which $INPUT_INTERNAL_GIT_BINARY);
|
||||
|
||||
echo "::debug::Path to git binary ${PATH_TO_GIT}";
|
||||
if hash -- "$INPUT_INTERNAL_GIT_BINARY" 2> /dev/null; then
|
||||
echo "git found";
|
||||
echo "::debug::git binary found";
|
||||
else
|
||||
echo "git not found. git-auto-commit requires git to be available." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
_switch_to_repository() {
|
||||
|
|
|
@ -1051,4 +1051,5 @@ cat_github_output() {
|
|||
run git_auto_commit
|
||||
|
||||
assert_failure;
|
||||
assert_line "git not found. git-auto-commit requires git to be available."
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue