Skip to content

Commit

Permalink
fix build scripts when git refs are defined by their branch name
Browse files Browse the repository at this point in the history
This fixes the case when secp256k1 is already cloned. Other packages are not affected because their git ref is a commit hash.
  • Loading branch information
PiRK committed Jan 11, 2023
1 parent 104ab04 commit 9b08f0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ 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"
# Just make sure there are no accidental changes
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}
Expand Down

0 comments on commit 9b08f0c

Please sign in to comment.