Prefer repository.branch_exists?
This commit is contained in:
parent
4f94053c21
commit
cf677378ee
|
@ -59,12 +59,12 @@ module Files
|
|||
end
|
||||
|
||||
unless project.empty_repo?
|
||||
unless @source_project.repository.branch_names.include?(@source_branch)
|
||||
unless @source_project.repository.branch_exists?(@source_branch)
|
||||
raise_error('You can only create or edit files when you are on a branch')
|
||||
end
|
||||
|
||||
if different_branch?
|
||||
if repository.branch_names.include?(@target_branch)
|
||||
if repository.branch_exists?(@target_branch)
|
||||
raise_error('Branch with such name already exists. You need to switch to this branch in order to make changes')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue