Browse code

Merge "make git_clone safer"

Jenkins authored on 2014/03/14 09:10:34
Showing 1 changed files
... ...
@@ -517,12 +517,14 @@ function git_clone {
517 517
     GIT_DEST=$2
518 518
     GIT_REF=$3
519 519
     RECLONE=$(trueorfalse False $RECLONE)
520
+    local orig_dir=`pwd`
520 521
 
521 522
     if [[ "$OFFLINE" = "True" ]]; then
522 523
         echo "Running in offline mode, clones already exist"
523 524
         # print out the results so we know what change was used in the logs
524 525
         cd $GIT_DEST
525 526
         git show --oneline | head -1
527
+        cd $orig_dir
526 528
         return
527 529
     fi
528 530
 
... ...
@@ -572,6 +574,7 @@ function git_clone {
572 572
     # print out the results so we know what change was used in the logs
573 573
     cd $GIT_DEST
574 574
     git show --oneline | head -1
575
+    cd $orig_dir
575 576
 }
576 577
 
577 578
 # git can sometimes get itself infinitely stuck with transient network