mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-15 16:53:25 +00:00
git: use git's HTTP proxy configs
I don't have an HTTP proxy to test with, but I hope this is all that's needed. Closes #34.
This commit is contained in:
parent
fdb861b957
commit
d434b948f1
1 changed files with 6 additions and 0 deletions
|
@ -145,6 +145,9 @@ pub fn fetch(
|
|||
git2::Cred::ssh_key_from_agent(username_from_url.unwrap())
|
||||
});
|
||||
let mut fetch_options = git2::FetchOptions::new();
|
||||
let mut proxy_options = git2::ProxyOptions::new();
|
||||
proxy_options.auto();
|
||||
fetch_options.proxy_options(proxy_options);
|
||||
fetch_options.remote_callbacks(callbacks);
|
||||
fetch_options.prune(FetchPrune::On);
|
||||
let refspec: &[&str] = &[];
|
||||
|
@ -282,6 +285,9 @@ fn push_refs(
|
|||
})?;
|
||||
let mut remaining_remote_refs: HashSet<_> = qualified_remote_refs.iter().copied().collect();
|
||||
let mut push_options = git2::PushOptions::new();
|
||||
let mut proxy_options = git2::ProxyOptions::new();
|
||||
proxy_options.auto();
|
||||
push_options.proxy_options(proxy_options);
|
||||
let mut callbacks = git2::RemoteCallbacks::new();
|
||||
callbacks.credentials(|_url, username_from_url, _allowed_types| {
|
||||
git2::Cred::ssh_key_from_agent(username_from_url.unwrap())
|
||||
|
|
Loading…
Reference in a new issue