Browse code

redux of reclone

Jesse Andrews authored on 2011/10/18 05:20:40
Showing 1 changed files
... ...
@@ -290,6 +290,13 @@ sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
290 290
 # be owned by the installation user, we create the directory and change the
291 291
 # ownership to the proper user.
292 292
 function git_clone {
293
+    # if there is an existing checkout, move it out of the way
294
+    if [[ "$RECLONE" == "yes" ]]; then
295
+        if [ -d $2 ]; then
296
+            mv $2 /tmp/stack.`date +%s`
297
+        fi
298
+    fi
299
+
293 300
     if [ ! -d $2 ]; then
294 301
         sudo mkdir $2
295 302
         sudo chown `whoami` $2
... ...
@@ -297,13 +304,6 @@ function git_clone {
297 297
         cd $2
298 298
         # This checkout syntax works for both branches and tags
299 299
         git checkout $3
300
-    elif [[ "$RESET_BRANCHES" == "yes" ]]; then
301
-        cd $2
302
-        git remote set-url origin $1
303
-        git fetch origin
304
-        git checkout origin/$3
305
-        git branch -D $3
306
-        git checkout -b $3
307 300
     fi
308 301
 }
309 302