twine-build: fetch pull requests from repo if can't find commit - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 483a2a40cdbafd11608cef087d4757825be100e4
DIR parent facb7bbc0e70420c3a894da255c5ac91628ca070
HTML Author: SomberNight <somber.night@protonmail.com>
Date: Sun, 27 May 2018 04:25:11 +0200
wine-build: fetch pull requests from repo if can't find commit
follow-up 25089aa9c2076db26b6d48822d59b4a703ef46b8
Diffstat:
M contrib/build-wine/build-electrum-… | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
---
DIR diff --git a/contrib/build-wine/build-electrum-git.sh b/contrib/build-wine/build-electrum-git.sh
t@@ -27,6 +27,13 @@ git clone https://github.com/spesmilo/electrum -b master
pushd electrum
if [ ! -z "$1" ]; then
+ # a commit/tag/branch was specified
+ if ! git cat-file -e "$1" 2> /dev/null
+ then # can't find target
+ # try pull requests
+ git config --local --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'
+ git fetch --all
+ fi
git checkout $1
fi