diff --git a/ci-job-validation.groovy b/ci-job-validation.groovy index 8aefae4ca..41ad22af5 100644 --- a/ci-job-validation.groovy +++ b/ci-job-validation.groovy @@ -29,7 +29,9 @@ node('cico-workspace') { } sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi" - sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + if (ref != git_since) { + sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + } } stage('check doc-only change') { diff --git a/containerized-tests.groovy b/containerized-tests.groovy index 6d08f55dd..6ce1b3f71 100644 --- a/containerized-tests.groovy +++ b/containerized-tests.groovy @@ -47,7 +47,9 @@ node('cico-workspace') { } sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi" - sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + if (ref != git_since) { + sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + } } stage('check doc-only change') { diff --git a/k8s-e2e-external-storage.groovy b/k8s-e2e-external-storage.groovy index a057ed0e3..b5a3f80cd 100644 --- a/k8s-e2e-external-storage.groovy +++ b/k8s-e2e-external-storage.groovy @@ -57,7 +57,9 @@ node('cico-workspace') { } sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi" - sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + if (ref != git_since) { + sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + } } stage('check doc-only change') { diff --git a/mini-e2e-helm.groovy b/mini-e2e-helm.groovy index 11a839a96..400e08ccd 100644 --- a/mini-e2e-helm.groovy +++ b/mini-e2e-helm.groovy @@ -73,7 +73,9 @@ node('cico-workspace') { } sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi" - sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + if (ref != git_since) { + sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + } } stage('check doc-only change') { diff --git a/mini-e2e.groovy b/mini-e2e.groovy index 6edc38fb9..30cc39246 100644 --- a/mini-e2e.groovy +++ b/mini-e2e.groovy @@ -70,7 +70,9 @@ node('cico-workspace') { } sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi" - sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + if (ref != git_since) { + sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + } } stage('check doc-only change') { diff --git a/upgrade-tests.groovy b/upgrade-tests.groovy index 37465c8e7..cfdb30669 100644 --- a/upgrade-tests.groovy +++ b/upgrade-tests.groovy @@ -70,7 +70,9 @@ node('cico-workspace') { } sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi" - sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + if (ref != git_since) { + sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD" + } } stage('check doc-only change') {