• Stan Hu's avatar
    Create the source branch for a GitHub import · e34a3213
    Stan Hu authored
    When the GitHub importer creates a merge request, it retrieves the SHA
    but does not actually create the source branch. This makes it impossible
    to merge an open merge request, particularly if the source branch were
    from a forked project. In that case, the branch will never exist because
    the original `project-name:source-branch` name is never created, nor
    is it a valid branch name.
    
    To prevent possible branch name conflicts, forked source branches
    are now renamed `github/fork/project-name/source-branch` and created
    when necessary.
    
    Note that we only create the source branch if the merge request
    is open. For projects that have many merge requests, the project
    would end up with a lot of possibly dead branches.
    
    Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57370
    e34a3213
pull_request.rb 3.62 KB