From f609ed6e45bb870c2b855ff6e0d4b4d7f36e7bd0 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 26 Jul 2024 13:38:48 +0100 Subject: fix(remote): authenticate pushes in the future we could implement our own credentials callback function to remove the dependancy --- src/git_remote_helper.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/git_remote_helper.rs') diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs index 6050d1a..2899fec 100644 --- a/src/git_remote_helper.rs +++ b/src/git_remote_helper.rs @@ -13,6 +13,7 @@ use std::{ }; use anyhow::{bail, Context, Result}; +use auth_git2::GitAuthenticator; #[cfg(not(test))] use client::Connect; use client::{fetching_with_report, get_repo_ref_from_cache}; @@ -97,8 +98,8 @@ async fn main() -> Result<()> { println!(); } ["push", refspec] => { - temp_remote.connect(git2::Direction::Push)?; - temp_remote.push(&[refspec], None)?; + let auth = GitAuthenticator::default(); + auth.push(&git_repo.git_repo, &mut temp_remote, &[refspec])?; temp_remote.disconnect()?; println!(); } -- cgit v1.2.3