redux of reclone

This commit is contained in:
Jesse Andrews 2011-10-17 13:20:40 -07:00
parent 16515c17d1
commit 1f27360089

View File

@ -290,6 +290,13 @@ sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
# be owned by the installation user, we create the directory and change the # be owned by the installation user, we create the directory and change the
# ownership to the proper user. # ownership to the proper user.
function git_clone { function git_clone {
# if there is an existing checkout, move it out of the way
if [[ "$RECLONE" == "yes" ]]; then
if [ -d $2 ]; then
mv $2 /tmp/stack.`date +%s`
fi
fi
if [ ! -d $2 ]; then if [ ! -d $2 ]; then
sudo mkdir $2 sudo mkdir $2
sudo chown `whoami` $2 sudo chown `whoami` $2
@ -297,13 +304,6 @@ function git_clone {
cd $2 cd $2
# This checkout syntax works for both branches and tags # This checkout syntax works for both branches and tags
git checkout $3 git checkout $3
elif [[ "$RESET_BRANCHES" == "yes" ]]; then
cd $2
git remote set-url origin $1
git fetch origin
git checkout origin/$3
git branch -D $3
git checkout -b $3
fi fi
} }