Prevent unnecessary git fetch calls.
Change-Id: I89df9f5491cc8fc49386e5f1496a9be51b443268 Reviewed-on: https://review.openstack.org/10959 Approved: Monty Taylor <mordred@inaugust.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
839348cad3
commit
11e1c4c558
@ -13,9 +13,13 @@ function clone_git() {
|
||||
if [ ! -d $MODULE_PATH/$REPO ] ; then
|
||||
git clone $REMOTE_URL $MODULE_PATH/$REPO
|
||||
fi
|
||||
(cd $MODULE_PATH/$REPO &&
|
||||
git fetch origin &&
|
||||
git reset --hard $REV >/dev/null )
|
||||
OLDDIR=`pwd`
|
||||
cd $MODULE_PATH/$REPO
|
||||
if ! git rev-parse HEAD | grep "^$REV" >/dev/null; then
|
||||
git fetch origin
|
||||
git reset --hard $REV >/dev/null
|
||||
fi
|
||||
cd $OLDDIR
|
||||
}
|
||||
|
||||
if ! puppet help module >/dev/null 2>&1 ; then
|
||||
|
Loading…
Reference in New Issue
Block a user