xbps-src: stop invoking chroot-git explicitly

Use /usr/libexec/chroot-git/git instead.

Honestly, I think xbps-src stop using chroot-git directly for a while,
since xbps-src invoke git to retrieve metadata outside of chroot in
order to support git's worktree.
This commit is contained in:
Đoàn Trần Công Danh 2024-02-13 22:18:26 +07:00 committed by Đoàn Trần Công Danh
parent f520fb31f3
commit 07cc9e1787
1 changed files with 5 additions and 4 deletions

View File

@ -568,13 +568,14 @@ if [ -d "$XBPS_MASTERDIR" -a ! -w "$XBPS_MASTERDIR" ]; then
fi
# Try using chroot-git then git from the host system
if command -v chroot-git &>/dev/null; then
export XBPS_GIT_CMD=$(command -v chroot-git)
elif command -v git &>/dev/null; then
export XBPS_GIT_CMD=$(command -v git)
XBPS_GIT_CMD="$(PATH="/usr/libexec/chroot-git:$PATH:$XBPS_MASTERDIR/usr/libexec/chroot-git" command -v git 2>/dev/null)"
if [ -n "$XBPS_GIT_CMD" ]; then
export XBPS_GIT_CMD
elif [ -z "$XBPS_USE_BUILD_MTIME" ] || [ "$XBPS_USE_GIT_REVS" ]; then
echo "neither chroot-git or git are available in your system!" 1>&2
exit 1
else
unset XBPS_GIT_CMD
fi
if [ -n "$XBPS_HOSTDIR" ]; then