Skip to content

Commit 987798a

Browse files
zeripatheeyrjmrsilverwind
authored
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 <[email protected]> Co-authored-by: JonRB <[email protected]> Co-authored-by: silverwind <[email protected]>
1 parent 13b74ac commit 987798a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/repository/hooks.go

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"os"
1010
"path/filepath"
11+
"runtime"
1112

1213
"code.gitea.io/gitea/modules/git"
1314
"code.gitea.io/gitea/modules/setting"
@@ -153,6 +154,10 @@ func createDelegateHooks(repoPath string) (err error) {
153154
}
154155

155156
func checkExecutable(filename string) bool {
157+
// windows has no concept of a executable bit
158+
if runtime.GOOS == "windows" {
159+
return true
160+
}
156161
fileInfo, err := os.Stat(filename)
157162
if err != nil {
158163
return false

0 commit comments

Comments
 (0)