Let package git depend on setting but not opposite (#15241)
* Let package git depend on setting but not opposite * private some package variables
This commit is contained in:
parent
e673e42f7e
commit
e3c626834b
17 changed files with 113 additions and 92 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/generate"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
||||
ini "gopkg.in/ini.v1"
|
||||
|
@ -67,24 +66,3 @@ func newLFSService() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CheckLFSVersion will check lfs version, if not satisfied, then disable it.
|
||||
func CheckLFSVersion() {
|
||||
if LFS.StartServer {
|
||||
//Disable LFS client hooks if installed for the current OS user
|
||||
//Needs at least git v2.1.2
|
||||
|
||||
err := git.LoadGitVersion()
|
||||
if err != nil {
|
||||
log.Fatal("Error retrieving git version: %v", err)
|
||||
}
|
||||
|
||||
if git.CheckGitVersionAtLeast("2.1.2") != nil {
|
||||
LFS.StartServer = false
|
||||
log.Error("LFS server support needs at least Git v2.1.2")
|
||||
} else {
|
||||
git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "filter.lfs.required=",
|
||||
"-c", "filter.lfs.smudge=", "-c", "filter.lfs.clean=")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue