From 1f0e9a2c2339c89a08fa8e2ea12f4c7a21436b61 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 26 Oct 2022 21:38:15 -0400 Subject: [PATCH] Add support for loading plaintext passwords from credential helper. Ref #469. --- lib/src/git.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/git.rs b/lib/src/git.rs index 3136f6ced3..b0c127f843 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -487,6 +487,12 @@ fn create_remote_callbacks(progress_cb: Option<&mut dyn FnMut(&Progress)>) -> Re } } } + if allowed_types.contains(git2::CredentialType::USER_PASS_PLAINTEXT) { + let Ok(config) = git2::Config::open_default(); + if let Ok(cred) = git2::Cred::credential_helper(config, _url) { + return cred; + } + } git2::Cred::default() }); callbacks