Gerrit.groovy: Use fetch refspec which includes refs/changes/*

To allow testing tf-m-ci-scripts patches submitted to Gerrit.

Related to https://linaro.atlassian.net/browse/TFC-639

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ic501c5983296fb3bd0a3e70dfc3527b078694941
diff --git a/src/org/trustedfirmware/Gerrit.groovy b/src/org/trustedfirmware/Gerrit.groovy
index e58574a..989b7fe 100644
--- a/src/org/trustedfirmware/Gerrit.groovy
+++ b/src/org/trustedfirmware/Gerrit.groovy
@@ -7,11 +7,24 @@
 
 package org.trustedfirmware
 
+
+def checkout_ci_scripts() {
+    checkout([
+        $class: 'GitSCM',
+        branches: [[name: '$CI_SCRIPTS_BRANCH']],
+        userRemoteConfigs: [[
+            credentialsId: 'GIT_SSH_KEY',
+            url: '$CI_SCRIPTS_REPO',
+            refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/remotes/origin/refs/changes/*'
+        ]]
+    ])
+}
+
 def verifyStatus(value, verify_name, category) {
   node("docker-amd64-tf-m-jammy") {
     cleanWs()
     dir("tf-m-ci-scripts") {
-      checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
+      checkout_ci_scripts()
     }
     verifyStatusInWorkspace(value, verify_name, category)
   }
@@ -39,7 +52,7 @@
   node("docker-amd64-tf-m-jammy") {
     cleanWs()
     dir("tf-m-ci-scripts") {
-      checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]])
+      checkout_ci_scripts()
     }
     commentInWorkspace(comment)
   }