From e24f0c5562f5a4f088227b5b6fe3c06eee8c053b2e16d00c1bcccdd840a9a35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 24 Jan 2012 14:58:40 +0000 Subject: [PATCH] Accepting request 101344 from home:schiele:branches:openSUSE:Tools Checking out a specific revision cannot work when only the latest version is cloned. OBS-URL: https://build.opensuse.org/request/show/101344 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-tar_scm?expand=0&rev=29 --- obs-service-tar_scm.changes | 6 ++++++ obs-service-tar_scm.spec | 2 +- tar_scm | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/obs-service-tar_scm.changes b/obs-service-tar_scm.changes index 2e1ca8b..f113d22 100644 --- a/obs-service-tar_scm.changes +++ b/obs-service-tar_scm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 24 13:26:19 UTC 2012 - rschiele@gmail.com + +- Checking out a specific revision cannot work when only the latest + version is cloned. + ------------------------------------------------------------------- Thu Dec 29 13:39:35 UTC 2011 - gollub@b1-systems.de diff --git a/obs-service-tar_scm.spec b/obs-service-tar_scm.spec index c0e3260..a03cb2f 100644 --- a/obs-service-tar_scm.spec +++ b/obs-service-tar_scm.spec @@ -1,7 +1,7 @@ # # spec file for package obs-service-tar_scm # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/tar_scm b/tar_scm index ad333da..6497742 100644 --- a/tar_scm +++ b/tar_scm @@ -192,11 +192,15 @@ elif [ "$MYSCM" == "git" ]; then mv "$TAR_DIRECTORY" "${FILE}" || exit 1 else # new checkout - git clone $MYGITARGS "$MYURL" "${FILE}" || exit 1 if [ -n "$MYREVISION" ]; then + #Clone with full depth; so that the revision can be found + git clone "$MYURL" "${FILE}" || exit 1 cd "$FILE" git checkout "$MYREVISION" || exit 1 cd - + else + #Clone only the latest revision + git clone --depth 1 "$MYURL" "${FILE}" || exit 1 fi fi if [ "$VERSION" == "_auto_" ]; then