Mailinglist Archive: opensuse-buildservice (256 mails)

< Previous Next >
Re: [opensuse-buildservice] [PATCH 1/3] [obs-service-tar_scm] Checkout master before git update
  • From: Adrian Schröter <adrian@xxxxxxx>
  • Date: Fri, 26 Aug 2011 08:36:52 +0200
  • Message-id: <1427946.IMYa1VYvF6@scherben>
Am Freitag, 26. August 2011, 08:43:05 schrieb Markus Lehtonen:
Check out master branch before doing git update so that merge succeeds
and the files are updated.

Would this still work when you actually want to checkout a non-master branch ?
eg. when MYREVISION is 2.3 for build-service repository ?

We may should do

fetch
checkout
merge

here instead ?

---
tar_scm | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tar_scm b/tar_scm
index 257b794..34b50f9 100644
--- a/tar_scm
+++ b/tar_scm
@@ -175,6 +175,8 @@ elif [ "$MYSCM" == "git" ]; then
# update existing content for speed/bandwidth reasons
cd "$TAR_DIRECTORY"
OLDVERSION=`git show --pretty=%at | head -n 1`
+ # switch to default branch so that merge succeeds
+ git checkout master || exit 1
git pull $MYGITARGS || exit 1
if [ -n "$MYREVISION" ]; then
git checkout "$MYREVISION" || exit 1
--
Adrian Schroeter
SUSE Linux Products GmbH
email: adrian@xxxxxxx

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >