use git2::{Cred, RemoteCallbacks};
use macro_log::*;
pub fn auth_callbacks<'a>(username: &'a str, password: &'a str) -> RemoteCallbacks<'a> {
let mut callbacks = RemoteCallbacks::new();
callbacks.credentials(|url, username_from_url, allowed_types| {
d!("请求凭证: {url:?} {username_from_url:?} {allowed_types:?}");
Cred::userpass_plaintext(username, password)
});
callbacks
}