Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
163ba974
Commit
163ba974
authored
Mar 20, 2017
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CreateBranchService after Repository#commit_file was renamed to create_file
Closes #29687
parent
46146e33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
app/services/create_branch_service.rb
app/services/create_branch_service.rb
+3
-3
spec/services/create_branch_service_spec.rb
spec/services/create_branch_service_spec.rb
+24
-0
No files found.
app/services/create_branch_service.rb
View file @
163ba974
...
@@ -25,12 +25,12 @@ class CreateBranchService < BaseService
...
@@ -25,12 +25,12 @@ class CreateBranchService < BaseService
private
private
def
create_master_branch
def
create_master_branch
project
.
repository
.
c
ommit
_file
(
project
.
repository
.
c
reate
_file
(
current_user
,
current_user
,
'/README.md'
,
'/README.md'
,
''
,
''
,
message:
'Add README.md'
,
message:
'Add README.md'
,
branch_name:
'master'
,
branch_name:
'master'
update:
false
)
)
end
end
end
end
spec/services/create_branch_service_spec.rb
0 → 100644
View file @
163ba974
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment