BigW Consortium Gitlab

Commit 169c70fd by Sean McGivern Committed by Lin Jen-Shin

Merge branch 'create-branch-service-create-file' into 'master'

Fix CreateBranchService after Repository#commit_file was renamed to create_file Closes #29687 See merge request !10081
parent afa4bd1b
......@@ -25,12 +25,12 @@ class CreateBranchService < BaseService
private
def create_master_branch
project.repository.commit_file(
project.repository.create_file(
current_user,
'/README.md',
'',
message: 'Add README.md',
branch_name: 'master',
update: false)
branch_name: 'master'
)
end
end
require 'spec_helper'
describe CreateBranchService, services: true do
let(:user) { create(:user) }
let(:service) { described_class.new(project, user) }
describe '#execute' do
context 'when repository is empty' do
let(:project) { create(:project_empty_repo) }
it 'creates master branch' do
service.execute('my-feature', 'master')
expect(project.repository.branch_exists?('master')).to be_truthy
end
it 'creates my-feature branch' do
service.execute('my-feature', 'master')
expect(project.repository.branch_exists?('my-feature')).to be_truthy
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