新增:创建分支已存在分支提示
This commit is contained in:
parent
129970a525
commit
c75953d343
|
@ -59,7 +59,11 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService
|
|||
if @body[:new_branch].present? && (@body[:new_branch].include?('/') || @body[:new_branch].include?('\'') || @body[:new_branch].include?('^') || @body[:new_branch].include?('*'))
|
||||
error("不合法的分支名称!")
|
||||
else
|
||||
error("#{filepath}文件已存在,不能重复创建!")
|
||||
if json_parse!(body)["message"].present? && json_parse!(body)["message"].starts_with?("branch already exists")
|
||||
error("#{@body[:new_branch]}分支已存在!")
|
||||
else
|
||||
error("#{filepath}文件已存在,不能重复创建!")
|
||||
end
|
||||
end
|
||||
else
|
||||
Rails.logger.error("Gitea api url==#{url},status:#{status},body=#{body}")
|
||||
|
|
Loading…
Reference in New Issue