Skip to content

Commit 2f218d0

Browse files
committed
Auto merge of #8986 - ehuss:fix-git-http-proxy, r=alexcrichton
Fix git http.proxy config setting. The `http.proxy` setting in `~/.gitconfig` was never being used. This is because the `get_str` method of `git2::Config` requires a "snapshot" config. Otherwise, it aways returns an error of "get_string called on a live config object". I'm not 100% positive it makes sense to fix this, since I'm uncertain this might introduce problems for people, but it seems to be the intent here.
2 parents 6477083 + a7d0539 commit 2f218d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cargo/ops/registry.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ fn http_proxy(config: &Config) -> CargoResult<Option<String>> {
683683
return Ok(Some(s.clone()));
684684
}
685685
if let Ok(cfg) = git2::Config::open_default() {
686-
if let Ok(s) = cfg.get_str("http.proxy") {
687-
return Ok(Some(s.to_string()));
686+
if let Ok(s) = cfg.get_string("http.proxy") {
687+
return Ok(Some(s));
688688
}
689689
}
690690
Ok(None)

0 commit comments

Comments
 (0)