feat: add git version on admin panel. (#921)
This commit is contained in:
parent
091f063706
commit
5cc275b1de
7 changed files with 14 additions and 3 deletions
|
@ -135,13 +135,14 @@ func NewRepoContext() {
|
|||
}
|
||||
|
||||
// Check Git version.
|
||||
gitVer, err := git.BinVersion()
|
||||
var err error
|
||||
setting.Git.Version, err = git.BinVersion()
|
||||
if err != nil {
|
||||
log.Fatal(4, "Failed to get Git version: %v", err)
|
||||
}
|
||||
|
||||
log.Info("Git Version: %s", gitVer)
|
||||
if version.Compare("1.7.1", gitVer, ">") {
|
||||
log.Info("Git Version: %s", setting.Git.Version)
|
||||
if version.Compare("1.7.1", setting.Git.Version, ">") {
|
||||
log.Fatal(4, "Gitea requires Git version greater or equal to 1.7.1")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue