From b7ba495aa91d745b5348eccd7716e1280c64e040 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 22 Apr 2018 09:35:23 +0200 Subject: [PATCH] build-from-source: fix checking-out branches by name Without it, `git checkout -B nmbuild nm-1-10` will fail, because there is no local branch refs/heads/nm-1-10. Previously, it worked because there was (one) refs/remotes/origin/nm-1-10, so if we didn't specify "-B" option, git would create a remote-tracking local branch. Fix it, by fetching the remote branches as local branches. Fixes: 2f67ac9eafde3f9979224ce6ce30de3d5f3e1862 --- contrib/rh-bkr/build-from-source.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/rh-bkr/build-from-source.sh b/contrib/rh-bkr/build-from-source.sh index 8eeb5287b5..7fc7fd758e 100755 --- a/contrib/rh-bkr/build-from-source.sh +++ b/contrib/rh-bkr/build-from-source.sh @@ -84,9 +84,10 @@ cd "./NetworkManager/" # if we fetch from a github repository, we also care about the refs to the pull-requests # fetch them too. +git config --add remote.origin.fetch '+refs/heads/*:refs/heads/*' git config --add remote.origin.fetch '+refs/tags/*:refs/nmbuild-origin/tags/*' git config --add remote.origin.fetch '+refs/pull/*:refs/nmbuild-origin/pull/*' -git fetch origin +git fetch origin --prune git checkout -B nmbuild "$BUILD_ID" echo "HEAD is $(git rev-parse HEAD)"