浏览代码

Remove unnecessary loading of settings in update hook (#9496)

This PR simply makes update an empty command rather than needlessly load the settings for each reference.
tags/v1.11.0-rc1
zeripath 4 年前
父节点
当前提交
154424623a
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入12 次删除
  1. 1
    12
      cmd/hook.go

+ 1
- 12
cmd/hook.go 查看文件

@@ -181,18 +181,7 @@ Gitea or set your environment appropriately.`, "")
}

func runHookUpdate(c *cli.Context) error {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
fail(`Rejecting changes as Gitea environment not set.
If you are pushing over SSH you must push with a key managed by
Gitea or set your environment appropriately.`, "")
} else {
return nil
}
}

setup("hooks/update.log", false)

// Update is empty and is kept only for backwards compatibility
return nil
}


正在加载...
取消
保存