common: simplify logic to find git

From chroot-git 2.33.1, we always have an executable named git
for other build infrastructure and lints.

Let's remove the shenanegan to find which git to be used, prepend the
path to chroot-git's git into $PATH, and let's the shell call the
correct git for us instead.
This commit is contained in:
Đoàn Trần Công Danh
2022-09-16 08:50:39 +07:00
committed by Đoàn Trần Công Danh
parent 77db514078
commit 7510b96218
5 changed files with 20 additions and 34 deletions

View File

@@ -33,13 +33,9 @@ jobs:
common/travis/prepare.sh
- name: Find cycles and open issues
run: |
if command -v chroot-git >/dev/null 2>&1; then
GIT_CMD=$(command -v chroot-git)
elif command -v git >/dev/null 2>&1; then
GIT_CMD=$(command -v git)
fi
PATH="/usr/libexec/chroot-git:$PATH"
# required by git 2.35.2+
$GIT_CMD config --global --add safe.directory "$PWD"
git config --global --add safe.directory "$PWD"
common/scripts/xbps-cycles.py | tee cycles
grep 'Cycle:' cycles | while read -r line; do
if gh issue list -R "$GITHUB_REPOSITORY" -S "$line" | grep .; then