Skip to content

Commit

Permalink
use VersionParsing.vparse in Git.version() (JuliaVersionControl#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Nov 7, 2018
1 parent b055d7b commit 932699b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
julia 0.6
Compat 0.47.0
BinDeps
VersionParsing
@osx Homebrew
11 changes: 2 additions & 9 deletions src/Git.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Git
#
using Compat
using Base: shell_escape
using VersionParsing
export gitcmd # determined by deps/build.jl and saved in deps/deps.jl

depsjl = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
Expand Down Expand Up @@ -88,15 +89,7 @@ end
Return the version of Git being used by the package.
"""
function version()
vs = split(readchomp(`version`), ' ')[3]
ns = split(vs, '.')
if length(ns) > 3
VersionNumber(join(ns[1:3], '.'))
else
VersionNumber(join(ns, '.'))
end
end
version() = vparse(readchomp(`version`))

"""
Git.modules(args; dir="")
Expand Down

0 comments on commit 932699b

Please sign in to comment.