From 987798a3a9123e7cbb50311a4cf5be3770f14b62 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 17 Aug 2022 23:34:29 +0100 Subject: [PATCH] Executable check always returns true for windows (#20637) (#20835) Backport #20637 Windows doesn't have the concept of "executable" POSIX bits so for now always return true to minimise doctor and logging noise. Addresses #20636 Co-authored-by: silverwind Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com> Co-authored-by: silverwind --- modules/repository/hooks.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/repository/hooks.go b/modules/repository/hooks.go index debaa0ecc..ec7e2298a 100644 --- a/modules/repository/hooks.go +++ b/modules/repository/hooks.go @@ -8,6 +8,7 @@ import ( "fmt" "os" "path/filepath" + "runtime" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/setting" @@ -153,6 +154,10 @@ func createDelegateHooks(repoPath string) (err error) { } func checkExecutable(filename string) bool { + // windows has no concept of a executable bit + if runtime.GOOS == "windows" { + return true + } fileInfo, err := os.Stat(filename) if err != nil { return false