Preferentially fetch from $CI_MERGE_REQUEST_REF_PATH if it is
defined, otherwise use $CI_COMMIT_REF_NAME
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
ci/cirrus/build.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml
index 9332e968bd..519e5ae144 100644
--- a/ci/cirrus/build.yml
+++ b/ci/cirrus/build.yml
@@ -4,6 +4,7 @@
env:
CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
+ CI_MERGE_REQUEST_REF_PATH: "@CI_MERGE_REQUEST_REF_PATH@"
CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
PATH: "@PATH@"
PKG_CONFIG_PATH: "@PKG_CONFIG_PATH@"
@@ -20,7 +21,7 @@ build_task:
- if test -n "@PYPI_PKGS@" ; then @PIP3@ install @PYPI_PKGS@ ; fi
clone_script:
- git clone --depth 100 "$CI_REPOSITORY_URL" .
- - git fetch origin "$CI_COMMIT_REF_NAME"
+ - git fetch origin "${CI_MERGE_REQUEST_REF_PATH:-$CI_COMMIT_REF_NAME}"
- git reset --hard "$CI_COMMIT_SHA"
build_script:
- meson setup build
--
2.40.1