diff options
author | Segev Finer <segev208@gmail.com> | 2019-04-17 08:31:08 +0300 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-17 01:31:08 -0400 |
commit | 34548369e1d78eb1141aecd4ab02acf59f2949ae (patch) | |
tree | 77ab26b7f7c7c4e53b604a8c4eec8d2a502b4af8 /modules | |
parent | 827ab6b75a70a3cd90033a4d49bb44c635dd3310 (diff) | |
download | gitea-34548369e1d78eb1141aecd4ab02acf59f2949ae.tar.gz gitea-34548369e1d78eb1141aecd4ab02acf59f2949ae.zip |
Add API for manipulating Git hooks (#6436)
* Add API for manipulating Git hooks
Signed-off-by: Segev Finer <segev@codeocean.com>
* Replace code.gitea.io/sdk with PR branch temporarily for CI
* Switch back to code.gitea.io/sdk@master
* Return 403 instead of 404 on no permission to edit hooks in API
* Add tests for Git hooks API
* Update models/repo_list_test.go
Co-Authored-By: segevfiner <segev208@gmail.com>
* Update models/repo_list_test.go
Co-Authored-By: segevfiner <segev208@gmail.com>
* empty line
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/api.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/context/api.go b/modules/context/api.go index 89b0bb749a..7e43d1f6bc 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -125,10 +125,10 @@ func APIContexter() macaron.Handler { } // ReferencesGitRepo injects the GitRepo into the Context -func ReferencesGitRepo() macaron.Handler { +func ReferencesGitRepo(allowEmpty bool) macaron.Handler { return func(ctx *APIContext) { // Empty repository does not have reference information. - if ctx.Repo.Repository.IsEmpty { + if !allowEmpty && ctx.Repo.Repository.IsEmpty { return } |