diff --git a/README.md b/README.md index 6dc623fb5..ab4ed118c 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,9 @@ Currently, the `@compat` macro supports the following syntaxes: * `using Compat.InteractiveUtils` is provided on versions older than 0.7, where this library is not yet part of the standard library ([#25780]). +* `using Compat.LibGit2` is provided on versions older than 0.7, where this library is + not yet part of the standard library ([#25706]). + ## New functions, macros, and methods * `@views` takes an expression and converts all slices to views ([#20164]), while @@ -538,5 +541,6 @@ includes this fix. Find the minimum version from there. [#25646]: https://github.com/JuliaLang/julia/issues/25646 [#25654]: https://github.com/JuliaLang/julia/issues/25654 [#25705]: https://github.com/JuliaLang/julia/issues/25705 +[#25706]: https://github.com/JuliaLang/julia/issues/25706 [#25780]: https://github.com/JuliaLang/julia/issues/25780 [#24182]: https://github.com/JuliaLang/julia/issues/24182 diff --git a/src/Compat.jl b/src/Compat.jl index 28a394b41..654be275b 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -1520,6 +1520,12 @@ else import InteractiveUtils end +@static if VERSION < v"0.7.0-DEV.3724" + const LibGit2 = Base.LibGit2 +else + import LibGit2 +end + # 0.7.0-DEV.2695 @static if !isdefined(Base, :AbstractDisplay) const AbstractDisplay = Display diff --git a/test/runtests.jl b/test/runtests.jl index ef9407992..562a8d711 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1302,6 +1302,14 @@ module TestInteractiveUtils @test isdefined(@__MODULE__, :varinfo) end +module TestLibGit2 + using Compat + using Compat.LibGit2 + using Compat.Test + @test isdefined(@__MODULE__, :LibGit2) + @test isdefined(@__MODULE__, :GitRepo) +end + # 0.7.0-DEV.3469 @test GC.enable(true) @test GC.enable(false)