Closed gcmurphy closed 6 years ago
I want to be able to specify command line arguments directly to clone, the returned repository has an invalid path assigned.
Here are some examples:
URL followed by cli arguments:
iex(20)> {_, repo} = Git.clone ["https://github.com/tuvistavie/elixir-git-cli", "--depth=1"] {:ok, %Git.Repository{path: "/private/tmp/--depth=1"}} iex(21)> Git.pull repo spawn: Could not cd to /private/tmp/--depth=1 {:error, %Git.Error{args: [], code: 2, command: "pull", message: ""}}
CLI arguments, followed by URL
iex(24)> {_, repo} = Git.clone ["--depth=1", "https://github.com/tuvistavie/elixir-git-cli"] {:ok, %Git.Repository{ path: "/private/tmp/https:/github.com/tuvistavie/elixir-git-cli" }} iex(25)> Git.pull repo spawn: Could not cd to /private/tmp/https:/github.com/tuvistavie/elixir-git-cli {:error, %Git.Error{args: [], code: 2, command: "pull", message: ""}}
Currently using something along these lines as a workaround for http/s urls:
clone = fn(repo, args) -> Git.clone! [repo] ++ args URI.parse(repo).path |> Path.rootname |> Path.basename |> Git.new end
Thanks for reporting. This should be fixed in the latest version.
I want to be able to specify command line arguments directly to clone, the returned repository has an invalid path assigned.
Here are some examples:
URL followed by cli arguments:
CLI arguments, followed by URL
Currently using something along these lines as a workaround for http/s urls: