Skip to content

Commit 82bf8f5

Browse files
committed
Use VersionParsing.vparse in Git.version() (#19)
1 parent 9bb08e3 commit 82bf8f5

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
julia 0.6
22
Compat 0.47.0
33
BinDeps
4+
VersionParsing
45
@osx Homebrew

src/Git.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Git
66
#
77
using Compat
88
using Base: shell_escape
9+
using VersionParsing
910
export gitcmd # determined by deps/build.jl and saved in deps/deps.jl
1011

1112
depsjl = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
@@ -88,15 +89,7 @@ end
8889
8990
Return the version of Git being used by the package.
9091
"""
91-
function version()
92-
vs = split(readchomp(`version`), ' ')[3]
93-
ns = split(vs, '.')
94-
if length(ns) > 3
95-
VersionNumber(join(ns[1:3], '.'))
96-
else
97-
VersionNumber(join(ns, '.'))
98-
end
99-
end
92+
version() = vparse(readchomp(`version`))
10093

10194
"""
10295
Git.modules(args; dir="")

0 commit comments

Comments
 (0)