From cacdf5e7247133bd2ad19ac541b595af9cf81d72 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 13 Nov 2015 10:54:14 +0100 Subject: [PATCH] xbps-src: use host git(1) to detect current branch. This now guesses correctly the current git branch when the target masterdir does not match the host architecture. --- xbps-src | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xbps-src b/xbps-src index 4830eef582b..706ded804cc 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}"