diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-09-16 11:29:53 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-09-16 11:29:53 -0400 |
commit | 62f21ff3ed1b85a1d3a1eab73da354e4f6e8794a (patch) | |
tree | 8a24c36310668ea14915883a367f8da194168bdc /modules/git/version.go | |
parent | 0d9c41be7d7d4ae1d2a28931be5565c8f6d3f792 (diff) | |
download | gitea-62f21ff3ed1b85a1d3a1eab73da354e4f6e8794a.tar.gz gitea-62f21ff3ed1b85a1d3a1eab73da354e4f6e8794a.zip |
Work on #476
Diffstat (limited to 'modules/git/version.go')
-rw-r--r-- | modules/git/version.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/git/version.go b/modules/git/version.go index 653503c03c..546397aa62 100644 --- a/modules/git/version.go +++ b/modules/git/version.go @@ -47,7 +47,7 @@ func MustParseVersion(verStr string) *Version { } // Compare compares two versions, -// it returns 1 if original is greater, 1 if original is smaller, 0 if equal. +// it returns 1 if original is greater, -1 if original is smaller, 0 if equal. func (v *Version) Compare(that *Version) int { if v.Major > that.Major { return 1 @@ -70,6 +70,10 @@ func (v *Version) Compare(that *Version) int { return 0 } +func (v *Version) LessThan(that *Version) bool { + return v.Compare(that) < 0 +} + // GetVersion returns current Git version installed. func GetVersion() (*Version, error) { if gitVer != nil { |