diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-09 15:28:23 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-12 09:00:05 +0300 |
commit | e34a321327cbbb1f615b9594c920dc04277bdb81 (patch) | |
tree | 61820dd5cde8cc0eacfe1f2c04aeabe78bffa97a /spec/lib/gitlab/github_import/representation | |
parent | 91b88e0be4a943aa7000c7d921e77fc200c53500 (diff) |
Create the source branch for a GitHub import
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
Diffstat (limited to 'spec/lib/gitlab/github_import/representation')
-rw-r--r-- | spec/lib/gitlab/github_import/representation/pull_request_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb index 33f6ff0ae6a..d478e5ae899 100644 --- a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb +++ b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb @@ -238,7 +238,7 @@ describe Gitlab::GithubImport::Representation::PullRequest do target_repository_id: 2 ) - expect(pr.formatted_source_branch).to eq('foo:branch') + expect(pr.formatted_source_branch).to eq('github/fork/foo/branch') end end |