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
This commit is contained in:
Adrian Schröter 2012-01-24 14:58:40 +00:00 committed by Git OBS Bridge
parent 8513bd36d0
commit e24f0c5562
3 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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