1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Fetch more commits from source repository to find merge-base

Gitlab CI fetches only 10 commits from source repository which might not be
enough for git merge-base.
This commit is contained in:
elsid 2023-04-25 23:48:25 +02:00
parent fe48348486
commit d82b41be08
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -51,6 +51,15 @@ TARGET_BRANCH="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-master}"
git fetch target "${TARGET_BRANCH:?}"
if [[ "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]]; then
git remote add source "${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}"
git fetch source "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
elif [[ "${CI_COMMIT_BRANCH}" ]]; then
git fetch origin "${CI_COMMIT_BRANCH:?}"
else
git fetch origin
fi
BASE_VERSION=$(git merge-base "target/${TARGET_BRANCH:?}" "${VERSION:?}")
# Save and use scripts from this commit because they may be absent or different in the base version