mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
Check SSH_AUTH_SOCK to determine existence of ssh-agent
This commit is contained in:
parent
ad79d89e4b
commit
4a1576c874
1 changed files with 1 additions and 1 deletions
|
@ -436,7 +436,7 @@ fn create_remote_callbacks() -> RemoteCallbacks<'static> {
|
|||
// crate shouldn't look in $HOME etc.
|
||||
callbacks.credentials(|_url, username_from_url, allowed_types| {
|
||||
if allowed_types.contains(git2::CredentialType::SSH_KEY) {
|
||||
if std::env::var("SSH_AGENT_PID").is_ok() {
|
||||
if std::env::var("SSH_AUTH_SOCK").is_ok() || std::env::var("SSH_AGENT_PID").is_ok() {
|
||||
return git2::Cred::ssh_key_from_agent(username_from_url.unwrap());
|
||||
}
|
||||
if let Ok(home_dir) = std::env::var("HOME") {
|
||||
|
|
Loading…
Reference in a new issue