summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/github_import
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-23 07:24:44 -0700
committerStan Hu <stanhu@gmail.com>2019-03-23 07:29:35 -0700
commitd0336ae88f9ed7bfee1f74d8945e4f8770d0b9b0 (patch)
tree70f71ad03bed27ce243269b40d9e2fe63297eead /spec/lib/gitlab/github_import
parent09d25b04c34398f9f825b3cc95265af3097fa035 (diff)
downloadgitlab-ce-d0336ae88f9ed7bfee1f74d8945e4f8770d0b9b0.tar.gz
GitHub importer: Use the project creator to create branches from forks
The project owner may actually be a group, in which case the branch creation would fail due to a lack of username. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59396
Diffstat (limited to 'spec/lib/gitlab/github_import')
-rw-r--r--spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
index 37c3fae7cb7..680de47de2b 100644
--- a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
@@ -273,10 +273,10 @@ describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redi
mr.state = 'opened'
mr.save
- # Ensure the project owner is creating the branches because the
+ # Ensure the project creator is creating the branches because the
# merge request author may not have access to push to this
- # repository.
- allow(project.repository).to receive(:add_branch).with(project.owner, anything, anything).and_call_original
+ # repository. The project owner may also be a group.
+ allow(project.repository).to receive(:add_branch).with(project.creator, anything, anything).and_call_original
importer.insert_git_data(mr, exists)