mirror of
https://codeberg.org/Cyborus/forgejo-cli.git
synced 2024-11-10 12:09:33 +01:00
Merge pull request 'authenticate properly in repo clone
' (#66) from auth-repo-clone into main
This commit is contained in:
commit
c30f7ad27f
1 changed files with 5 additions and 1 deletions
|
@ -482,14 +482,18 @@ impl RepoCommand {
|
||||||
..
|
..
|
||||||
} = *crate::special_render();
|
} = *crate::special_render();
|
||||||
|
|
||||||
|
let auth = auth_git2::GitAuthenticator::new();
|
||||||
|
let git_config = git2::Config::open_default()?;
|
||||||
|
|
||||||
let mut options = git2::FetchOptions::new();
|
let mut options = git2::FetchOptions::new();
|
||||||
|
let mut callbacks = git2::RemoteCallbacks::new();
|
||||||
|
callbacks.credentials(auth.credentials(&git_config));
|
||||||
|
|
||||||
if colors {
|
if colors {
|
||||||
print!("{hide_cursor}");
|
print!("{hide_cursor}");
|
||||||
print!(" Preparing...");
|
print!(" Preparing...");
|
||||||
let _ = std::io::stdout().flush();
|
let _ = std::io::stdout().flush();
|
||||||
|
|
||||||
let mut callbacks = git2::RemoteCallbacks::new();
|
|
||||||
callbacks.transfer_progress(|progress| {
|
callbacks.transfer_progress(|progress| {
|
||||||
print!("{clear_line}\r");
|
print!("{clear_line}\r");
|
||||||
if progress.received_objects() == progress.total_objects() {
|
if progress.received_objects() == progress.total_objects() {
|
||||||
|
|
Loading…
Reference in a new issue