Commit 23e74a47 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'fix_rebase_feature' into 'master'

Fix "Rebasing not working with Merge Requests"

Closes #2979

See merge request !2531
parents 7bfa86a2 7b7ccd51
......@@ -49,7 +49,11 @@ module MergeRequests
end
def git_env
{ 'GL_ID' => Gitlab::GlId.gl_id(current_user), 'GL_PROTOCOL' => 'web' }
{
'GL_ID' => Gitlab::GlId.gl_id(current_user),
'GL_PROTOCOL' => 'web',
'GL_REPOSITORY' => Gitlab::GlRepository.gl_repository(project, false)
}
end
# Don't try to print expensive instance variables.
......
---
title: Fix Rebasing not working with Merge Requests
merge_request:
author:
......@@ -40,6 +40,21 @@ describe MergeRequests::RebaseService do
expect(head_commit.committer_email).to eq(user.email)
expect(head_commit.committer_name).to eq(user.name)
end
context 'git commands' do
let(:service) { described_class.new(project, user, {}) }
it 'sets GL_REPOSITORY env variable when calling git commands' do
expect_any_instance_of(described_class)
.to receive(:run_git_command).exactly(4).with(
anything,
anything,
hash_including('GL_REPOSITORY'),
anything)
service.execute(merge_request)
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment