This matches cargo's behavior for registries that are not hosted on
GitHub (like Cloudsmith), and uses the configured git credential helper
to allow cloning private registries.
I'm as surprised as you probably are that cargo normalizes:
this:
https://github.com/rust-lang/crates.io-index.git
to this:
https://github.com/rust-lang/crates.io-index
But keeps something like https://dl.cloudsmith.io/basic/myorg/myrepo/cargo/index.git as-is. But if we don't reproduce cargo's behavior there, we won't use the same checkout directories, using up more disk space and being generally out-of-sync with cargo.
The other change is rather straightforward, I'm not sure why it's not libgit2's default, but apparently you need to spell out "please use the configured git credential helper to clone stuff". At least for Cloudsmith crate registries, that's a prerequisite - every user gets their own API token that's configured in something like ~/.git-credentials:
...or really any of the Git credential helpers that exist. The bit of config in that PR should work no matter the credential helper, whether it's "store", some GUI thing on Windows, VSCode's odd "git credential forwarding helper" for dev containers, etc.
This matches cargo's behavior for registries that are not hosted on GitHub (like Cloudsmith), and uses the configured git credential helper to allow cloning private registries.
Needed for https://github.com/pksunkara/cargo-workspaces/pull/53
I'm as surprised as you probably are that cargo normalizes:
But keeps something like
https://dl.cloudsmith.io/basic/myorg/myrepo/cargo/index.git
as-is. But if we don't reproduce cargo's behavior there, we won't use the same checkout directories, using up more disk space and being generally out-of-sync with cargo.The other change is rather straightforward, I'm not sure why it's not libgit2's default, but apparently you need to spell out "please use the configured git credential helper to clone stuff". At least for Cloudsmith crate registries, that's a prerequisite - every user gets their own API token that's configured in something like
~/.git-credentials
:...or really any of the Git credential helpers that exist. The bit of config in that PR should work no matter the credential helper, whether it's "store", some GUI thing on Windows, VSCode's odd "git credential forwarding helper" for dev containers, etc.