diff --git a/xbps-src b/xbps-src index 4830eef582..706ded804c 100755 --- a/xbps-src +++ b/xbps-src @@ -245,7 +245,11 @@ check_build_requirements() { if [ -z "$XBPS_ALT_REPOSITORY" ]; then pushd "$PWD" &>/dev/null cd $XBPS_DISTDIR - _gitbranch="$(chroot-git symbolic-ref --short HEAD 2>/dev/null)" + if [ -n "$IN_CHROOT" ]; then + _gitbranch="$(chroot-git symbolic-ref --short HEAD 2>/dev/null)" + else + _gitbranch="$(git symbolic-ref --short HEAD 2>/dev/null)" + fi if [ -n "${_gitbranch}" -a "${_gitbranch}" != "master" ]; then export XBPS_ALT_REPOSITORY="${_gitbranch}" export XBPS_REPOSITORY="${XBPS_REPOSITORY}/${_gitbranch}"