From 9b08f0c3c1dc62a9979c99dd439a57a0caf6ce21 Mon Sep 17 00:00:00 2001 From: PiRK Date: Tue, 10 Jan 2023 16:06:39 +0100 Subject: [PATCH] fix build scripts when git refs are defined by their branch name This fixes the case when secp256k1 is already cloned. Other packages are not affected because their git ref is a commit hash. --- contrib/base.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/base.sh b/contrib/base.sh index 033319db078d..25d1254eda4d 100644 --- a/contrib/base.sh +++ b/contrib/base.sh @@ -176,7 +176,7 @@ function setup_pkg() if [ -d "$pkgbuilddir" ] ; then pushd "$pkgbuilddir" local commit=`git rev-parse HEAD` - local branch=`git rev-parse --abbrev-ref` + local branch=`git rev-parse --abbrev-ref HEAD` local tag=`git describe --tags` if [[ ${commit} = ${checkout_ref} || ${branch} = ${checkout_ref} || ${tag} = ${checkout_ref} ]] ; then warn "$pkgname already cloned and $checkout_ref is already the current HEAD" @@ -184,7 +184,7 @@ function setup_pkg() git stash return fi - fail "$pkgname already cloned, but HEAD is not at expected ref ${checkout_ref}" + fail "$pkgname already cloned, but HEAD is not at expected ref ${checkout_ref} (branch ${branch}, commit ${commit})" popd fi git clone ${git_url}