mirror of https://github.com/GNOME/gimp.git
.gitlab: search common git ancestor with `mr-origin` remote.
It looks like origin is the same as mr-origin when the contributor pushes to one's branch. But when a reviewer rebases through the Gitlab "Rebase" button on web GUI, I got a fatal error: > fatal: ambiguous argument 'origin/asalle/use-dynamics-flag': unknown revision or path not in the working tree. Possibly `origin` is then the remote of the person who rebased (it would be weird, yet it's a fact the branch is not found). Let's go with this assumption.
This commit is contained in:
parent
9385a6405a
commit
1e47c8916a
|
@ -30,7 +30,7 @@ git remote add mr-origin ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}
|
|||
source_branch="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-${CI_COMMIT_BRANCH}}"
|
||||
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" mr-origin "${source_branch}" &> ./fetch_origin.log
|
||||
|
||||
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list --first-parent "origin/${source_branch}") | head -1)
|
||||
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list --first-parent "mr-origin/${source_branch}") | head -1)
|
||||
if [ -z "${newest_common_ancestor_sha}" ]; then
|
||||
echo "Couldn’t find common ancestor with upstream main branch. This typically"
|
||||
echo "happens if you branched from main a long time ago. Please update"
|
||||
|
|
Loading…
Reference in New Issue