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 <me@silverwind.io> Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
13b74accda
commit
987798a3a9
1 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
@ -153,6 +154,10 @@ func createDelegateHooks(repoPath string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkExecutable(filename string) bool {
|
func checkExecutable(filename string) bool {
|
||||||
|
// windows has no concept of a executable bit
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
fileInfo, err := os.Stat(filename)
|
fileInfo, err := os.Stat(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
|
|
Reference in a new issue