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
Tatuya Kamada
gitlab-ce
Commits
f2464a13
Commit
f2464a13
authored
Mar 02, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't require start branch to exist if we're just creating a new branch
parent
e7bf621a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
app/services/git_operation_service.rb
app/services/git_operation_service.rb
+7
-11
No files found.
app/services/git_operation_service.rb
View file @
f2464a13
...
...
@@ -56,14 +56,17 @@ class GitOperationService
start_project:
repository
.
project
,
&
block
)
start_branch_name
||=
branch_name
start_repository
=
start_project
.
repository
start_branch_name
=
nil
if
start_repository
.
empty_repo?
verify_start_branch_exists!
(
start_project
.
repository
,
start_branch_name
)
if
start_branch_name
&&
!
start_repository
.
branch_exists?
(
start_branch_name
)
raise
ArgumentError
,
"Cannot find branch
#{
start_branch_name
}
in
#{
start_repository
.
path_with_namespace
}
"
end
update_branch_with_hooks
(
branch_name
)
do
repository
.
with_repo_branch_commit
(
start_
project
.
repository
,
start_branch_name
,
start_repository
,
start_branch_name
||
branch_name
,
&
block
)
end
end
...
...
@@ -150,11 +153,4 @@ class GitOperationService
repository
.
raw_repository
.
autocrlf
=
:input
end
end
def
verify_start_branch_exists!
(
start_repository
,
start_branch_name
)
return
if
start_repository
.
empty_repo?
return
if
start_repository
.
branch_exists?
(
start_branch_name
)
raise
ArgumentError
,
"Cannot find branch
#{
start_branch_name
}
in
#{
start_repository
.
path_with_namespace
}
"
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