diff options
author | JonRB <4564448+eeyrjmr@users.noreply.github.com> | 2022-08-04 08:28:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 15:28:32 +0800 |
commit | 7cc7c3e449ae37355196695ba6a7ae2bb1cc9b27 (patch) | |
tree | 6ed84864e14c5a46ac8acbe9e72a41b4433a0e25 /modules/repository/hooks.go | |
parent | cf06e20c0ded4f2190e18d824be91f00f95e5f3e (diff) | |
download | gitea-7cc7c3e449ae37355196695ba6a7ae2bb1cc9b27.tar.gz gitea-7cc7c3e449ae37355196695ba6a7ae2bb1cc9b27.zip |
Executable check always returns true for windows (#20637)
* Executable check always returns true for windows
Windows doesn't have the concept of "executable" POSIX bits so for now always return true to minimise doctor and logging noise. Addresses #20636
* gofmt tweak
* Update modules/repository/hooks.go
Co-authored-by: silverwind <me@silverwind.io>
* gofmt comment line
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/repository/hooks.go')
-rw-r--r-- | modules/repository/hooks.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/repository/hooks.go b/modules/repository/hooks.go index c2eb3a7c75..7bc77552bd 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 |