Skip to content

Commit

Permalink
Use jll version of git via Git package.
Browse files Browse the repository at this point in the history
  • Loading branch information
GunnarFarneback committed Nov 14, 2023
1 parent eb8ba40 commit eeb0449
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ authors = ["Gunnar Farnebäck <[email protected]>"]
version = "0.5.6"

[deps]
Git = "d7ba0133-e1db-5d97-8f8c-041e4b3a1eb2"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RegistryInstances = "2792f1a3-b283-48e8-9a74-f99dce5104f3"
RegistryTools = "d1eb7eb1-105f-429d-abf5-b0f65cb9e2c4"
Expand All @@ -12,8 +13,9 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
CodecZlib = "0.5, 0.6, 0.7"
Git = "1.3"
RegistryInstances = "0.1"
RegistryTools = "2.0"
RegistryTools = "2.2"
julia = "1.6"

[extras]
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ companion package
This package requires Julia 1.6 or later. Older versions of the
package work back to Julia 1.1.

## Prerequisites

You need to have command line `git` installed and available in the
system `PATH`. If
```
run(`git --version`)
```
in the Julia REPL prints a version number rather than giving an error,
you are good to go.

## Installation

```
Expand Down
17 changes: 6 additions & 11 deletions src/LocalRegistry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ using RegistryTools: RegistryTools, Compress,
using RegistryInstances: RegistryInstance, reachable_registries
using UUIDs: uuid4
import TOML
import Git

export create_registry, register

Expand Down Expand Up @@ -608,18 +609,12 @@ function gitlab(branch, pkg, new_package, repo, commit)
end

function gitcmd(path::AbstractString, gitconfig::Dict)
if Sys.iswindows()
# Workaround for https://github.com/GunnarFarneback/LocalRegistry.jl/issues/76.
# Cf. https://github.com/ziglang/zig/issues/16526#issuecomment-1648706259
cmd = ["cmd", "/c", "git", "-C", path]
else
cmd = ["git", "-C", path]
end
for (n,v) in gitconfig
push!(cmd, "-c")
push!(cmd, "$n=$v")
args = ["-C", path]
for (k, v) in gitconfig
push!(args, "-c")
push!(args, "$k=$v")
end
Cmd(cmd)
return Git.git(args)
end

end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using CodecZlib
const TEST_GITCONFIG = Dict(
"user.name" => "LocalRegistryTests",
"user.email" => "[email protected]",
"core.autocrlf" => "input"
)

include("utils.jl")
Expand Down

0 comments on commit eeb0449

Please sign in to comment.