From 956415b55b4c2c52977158aa9bec2bf7aa229434 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Sat, 18 May 2024 12:20:30 -0400 Subject: [PATCH] authenticate properly in `repo clone` --- src/repo.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/repo.rs b/src/repo.rs index bb19908..16bcc0b 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -482,14 +482,18 @@ impl RepoCommand { .. } = *crate::special_render(); + let auth = auth_git2::GitAuthenticator::new(); + let git_config = git2::Config::open_default()?; + let mut options = git2::FetchOptions::new(); + let mut callbacks = git2::RemoteCallbacks::new(); + callbacks.credentials(auth.credentials(&git_config)); if colors { print!("{hide_cursor}"); print!(" Preparing..."); let _ = std::io::stdout().flush(); - let mut callbacks = git2::RemoteCallbacks::new(); callbacks.transfer_progress(|progress| { print!("{clear_line}\r"); if progress.received_objects() == progress.total_objects() {