Skip to content

Commit eb076e8

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "git: git checkout for a commit hash combinated with depth argument" into stable/yoga
2 parents 4062cc0 + 0a1ea3e commit eb076e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

functions-common

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,10 @@ function git_clone {
646646
echo "the project to the \$PROJECTS variable in the job definition."
647647
die $LINENO "ERROR_ON_CLONE is set to True so cloning not allowed in this configuration"
648648
fi
649-
git_timed clone $git_clone_flags $git_remote $git_dest
649+
git_timed clone --no-checkout $git_clone_flags $git_remote $git_dest
650650
cd $git_dest
651-
git checkout $git_ref
651+
git_timed fetch $git_clone_flags origin $git_ref
652+
git_timed checkout FETCH_HEAD
652653
elif [[ "$RECLONE" = "True" ]]; then
653654
# if it does exist then simulate what clone does if asked to RECLONE
654655
cd $git_dest

0 commit comments

Comments
 (0)