Compare commits

...

9 Commits

4 changed files with 476 additions and 242 deletions

703
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
git2 = { version = "0.16.1" }
git2 = { version = "0.20.0" }
clap = "4.2.1"
color-eyre = "0.6.2"
dotenv = "0.15.0"

3
renovate.json Normal file
View File

@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

View File

@@ -40,7 +40,10 @@ async fn main() -> eyre::Result<()> {
);
let mut cb = RemoteCallbacks::new();
cb.credentials(|_, _, _| {
cb.credentials(|_, username, _| {
if let Some(sock) = std::env::var("SSH_AUTH_SOCK").ok() {
return Cred::ssh_key_from_agent(username.unwrap_or("git"));
}
let username = std::env::var("GIT_USERNAME").expect("GIT_USERNAME to be set");
let password = std::env::var("GIT_PASSWORD").expect("GIT_PASSWORD to be set");
Cred::userpass_plaintext(&username, &password)
@@ -115,7 +118,10 @@ async fn main() -> eyre::Result<()> {
let mut remote = repo.find_remote("origin")?;
let mut cb = RemoteCallbacks::new();
cb.credentials(|_, _, _| {
cb.credentials(|_, username, _| {
if let Some(sock) = std::env::var("SSH_AUTH_SOCK").ok() {
return Cred::ssh_key_from_agent(username.unwrap_or("git"));
}
let username = std::env::var("GIT_USERNAME").expect("GIT_USERNAME to be set");
let password = std::env::var("GIT_PASSWORD").expect("GIT_PASSWORD to be set");
Cred::userpass_plaintext(&username, &password)