From 34548369e1d78eb1141aecd4ab02acf59f2949ae Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Wed, 17 Apr 2019 08:31:08 +0300 Subject: Add API for manipulating Git hooks (#6436) * Add API for manipulating Git hooks Signed-off-by: Segev Finer * 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 * Update models/repo_list_test.go Co-Authored-By: segevfiner * empty line --- modules/context/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') 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 } -- cgit v1.2.3