Git fail for all merge request in git clone

Bitrise Build Issue Report template

Description of the issue

Where did the issue happen?

As mentioned on other tickets :

I have a self-hosted gitlab instance and I try to make a merge request from a fork to the main repo.

Environment:

Where did the issue happen?

on Bitrise.io : Xcode 11.3.x, on macOS 10.14.6 (Mojave)

Which build Step causes the issue and which version of the step?

Git Clone v4.0.18

Reproducibility

  • Does a “Rebuild” help? NO
  • Does a rebuild without caches help? : NO
  • Does the issue happen sporadically, or every time? : every time
  • Does upgrading the build Step to the latest version help? : NO

Build log

git "init"
Initialized empty Git repository in /Users/vagrant/git/.git/
git "remote" "add" "origin" "https://xxxxxx/xxxxx/xxxxx"
git "fetch" "--depth=5" "origin" "develop"
warning: redirecting to https://xxxxxx/xxxxx/xxxx/
From https://xxxxxx/xxxxx/xxxx
 * branch              develop    -> FETCH_HEAD
 * [new branch]        develop    -> origin/develop
ERROR: auto merge, error: there is no Pull Request branch and can't download diff file

A ticket for the issue on this problem is open : case 4974

Thanks

1 Like

I was able to workaround this issue using a custom script :
The problem was BITRISEIO_PULL_REQUEST_REPOSITORY_URL was not called before git failed, and it was a ssh url but the access to the repo is https only.

firstly, I transform my ssh url into a https one

firstSubstring="https://"
httpsUrl=${BITRISEIO_PULL_REQUEST_REPOSITORY_URL/git@/$firstSubstring}
httpsUrl=${httpsUrl/tech:/"tech/"}

envman add --key GIT_SOURCE_REPOSITORY_URL --value "$httpsUrl"

secondly I called it in a script to clone manually

git clone $GIT_SOURCE_REPOSITORY_URL --branch $BITRISE_GIT_BRANCH --single-branch --depth 1 . 
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.