diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-06-20 00:53:37 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-06-19 19:53:37 +0300 |
commit | 8ec659722df32048561c713f2d533a20a7f0d5ef (patch) | |
tree | 65294eb54428215b23401081c657881680168ed1 /cmd/serv.go | |
parent | a71cabbd537d2ca3f937e8fb986315ccc6701270 (diff) | |
download | gitea-8ec659722df32048561c713f2d533a20a7f0d5ef.tar.gz gitea-8ec659722df32048561c713f2d533a20a7f0d5ef.zip |
Only check and config git on web subcommand but not others (#7236)
* only check and config git on web subcommand but not others
* add Init in git tests
Diffstat (limited to 'cmd/serv.go')
-rw-r--r-- | cmd/serv.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/cmd/serv.go b/cmd/serv.go index c1c8fd3a97..2ea89757db 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -17,7 +17,6 @@ import ( "time" "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/pprof" "code.gitea.io/gitea/modules/private" @@ -25,7 +24,6 @@ import ( "github.com/Unknwon/com" "github.com/dgrijalva/jwt-go" - version "github.com/mcuadros/go-version" "github.com/urfave/cli" ) @@ -46,29 +44,9 @@ var CmdServ = cli.Command{ }, } -func checkLFSVersion() { - if setting.LFS.StartServer { - //Disable LFS client hooks if installed for the current OS user - //Needs at least git v2.1.2 - binVersion, err := git.BinVersion() - if err != nil { - fail("LFS server error", "Error retrieving git version: %v", err) - } - - if !version.Compare(binVersion, "2.1.2", ">=") { - setting.LFS.StartServer = false - println("LFS server support needs at least Git v2.1.2, disabled") - } else { - git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "filter.lfs.required=", - "-c", "filter.lfs.smudge=", "-c", "filter.lfs.clean=") - } - } -} - func setup(logPath string) { _ = log.DelLogger("console") setting.NewContext() - checkLFSVersion() } func parseCmd(cmd string) (string, string) { |