|
|
|
@@ -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}") |
|
|
|
|