File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1- version : 10.1.17
1+ version : 10.1.18
Original file line number Diff line number Diff line change @@ -64,6 +64,18 @@ delete_process_lock_files () {
6464 fi
6565}
6666
67+ git_checkout () {
68+ revision=" $REVISION "
69+ # when revision is Gerrit branch we need to fetch it explicitly
70+ if [[ " $REVISION " =~ ^refs/changes/[0-9]+/[0-9]+/[0-9]+$ ]]; then
71+ echo " Fetching Gerrit Change ref: $REVISION "
72+ git_retry git fetch origin $REVISION
73+ revision=" FETCH_HEAD"
74+ fi
75+
76+ git checkout $revision
77+ }
78+
6779trap exit_trap EXIT
6880set -e
6981
@@ -165,7 +177,7 @@ if [ -d "$CLONE_DIR" ]; then
165177 if [ -n " $REVISION " ]; then
166178
167179 echo " Updating repository to revision $REVISION "
168- git checkout $REVISION
180+ git_checkout
169181
170182 CURRENT_BRANCH=" ` git branch 2> /dev/null | grep ' ^*' | cut -d' ' -f2-` "
171183
@@ -184,7 +196,7 @@ if [ -d "$CLONE_DIR" ]; then
184196 cd $CLONE_DIR
185197
186198 if [ -n " $REVISION " ]; then
187- git checkout $REVISION
199+ git_checkout
188200 fi
189201 fi
190202else
193205 eval $GIT_COMMAND
194206 cd $CLONE_DIR
195207 if [ -n " $REVISION " ]; then
196- git checkout $REVISION
208+ git_checkout
197209 fi
198210
199211fi
You can’t perform that action at this time.
0 commit comments