This repository was archived by the owner on Apr 12, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright 2015 The Gogs Authors. All rights reserved.
2
+ // Copyright 2017 The Gitea Authors. All rights reserved.
2
3
// Use of this source code is governed by a MIT-style
3
4
// license that can be found in the LICENSE file.
4
5
8
9
"fmt"
9
10
"strings"
10
11
"time"
12
+
13
+ "github.com/mcuadros/go-version"
11
14
)
12
15
13
16
// Version return this package's current version
21
24
Debug = false
22
25
// Prefix the log prefix
23
26
Prefix = "[git-module] "
27
+ // GitVersionRequired is the minimum Git version required
28
+ GitVersionRequired = "1.7.10"
24
29
)
25
30
26
31
func log (format string , args ... interface {}) {
@@ -66,7 +71,13 @@ func BinVersion() (string, error) {
66
71
}
67
72
68
73
func init () {
69
- BinVersion ()
74
+ gitVersion , err := BinVersion ()
75
+ if err != nil {
76
+ panic (fmt .Sprintf ("Git version missing: %v" , err ))
77
+ }
78
+ if version .Compare (gitVersion , GitVersionRequired , "<" ) {
79
+ panic (fmt .Sprintf ("Git version not supported. Requires version > %v" , GitVersionRequired ))
80
+ }
70
81
}
71
82
72
83
// Fsck verifies the connectivity and validity of the objects in the database
You can’t perform that action at this time.
0 commit comments