Merge "Pass branch parameter to git clone"

This commit is contained in:
Jenkins 2016-11-28 10:06:24 +00:00 committed by Gerrit Code Review
commit 4d61ed5c77

View File

@ -534,10 +534,8 @@ function git_clone {
echo "the project to the \$PROJECTS variable in the job definition."
die $LINENO "Cloning not allowed in this configuration"
fi
git_timed clone $git_clone_flags $git_remote $git_dest
cd $git_dest
# This checkout syntax works for both branches and tags
git checkout $git_ref
# '--branch' can also take tags
git_timed clone $git_clone_flags $git_remote $git_dest --branch $git_ref
elif [[ "$RECLONE" = "True" ]]; then
# if it does exist then simulate what clone does if asked to RECLONE
cd $git_dest