Browse code

Merge "Pass branch parameter to git clone"

Jenkins authored on 2016/11/28 19:06:24
Showing 1 changed files
... ...
@@ -534,10 +534,8 @@ function git_clone {
534 534
                 echo "the project to the \$PROJECTS variable in the job definition."
535 535
                 die $LINENO "Cloning not allowed in this configuration"
536 536
             fi
537
-            git_timed clone $git_clone_flags $git_remote $git_dest
538
-            cd $git_dest
539
-            # This checkout syntax works for both branches and tags
540
-            git checkout $git_ref
537
+            # '--branch' can also take tags
538
+            git_timed clone $git_clone_flags $git_remote $git_dest --branch $git_ref
541 539
         elif [[ "$RECLONE" = "True" ]]; then
542 540
             # if it does exist then simulate what clone does if asked to RECLONE
543 541
             cd $git_dest