Browse Source

修复:提交文件未创建新分支时为空判断

pull/313/head
yystopf 3 years ago
parent
commit
c6e77ac7ee
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/services/gitea/repository/entries/create_service.rb

+ 1
- 1
app/services/gitea/repository/entries/create_service.rb View File

@@ -56,7 +56,7 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService
when 403 then error("你没有权限操作!")
when 404 then error("你操作的链接不存在!")
when 422
if @body[:new_branch].include?('/') || @body[:new_branch].include?('\'') || @body[:new_branch].include?('^') || @body[:new_branch].include?('*')
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}文件已存在,不能重复创建!")


Loading…
Cancel
Save