From b03c41b767caa8cea8ab2b58559a7ef07b352cfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Sep 2026 22:09:33 -0700 Subject: [PATCH] chore(deps): bump git2 from 0.20.4 to 0.21.0 (#703) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gregory Schier --- Cargo.lock | 35 ++++++---------------------------- crates/yaak-git/Cargo.toml | 2 +- crates/yaak-git/src/log.rs | 6 +++--- crates/yaak-git/src/pull.rs | 9 +++++---- crates/yaak-git/src/push.rs | 9 +++++---- crates/yaak-git/src/remotes.rs | 7 ++++--- crates/yaak-git/src/status.rs | 10 +++++----- crates/yaak-git/src/util.rs | 3 ++- 8 files changed, 31 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 98a70828f..bbff0f5e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2950,17 +2950,15 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.4" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ "bitflags 2.11.0", "libc", "libgit2-sys", "log 0.4.34", - "openssl-probe 0.1.6", "openssl-sys", - "url", ] [[package]] @@ -4103,13 +4101,12 @@ dependencies = [ [[package]] name = "libgit2-sys" -version = "0.18.3+1.9.2" +version = "0.18.8+1.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" +checksum = "7f7c568b25d7489bc3fb2988ed69ab111d2944d2f5fec3d5c987fe545ea97b50" dependencies = [ "cc", "libc", - "libssh2-sys", "libz-sys", "openssl-sys", "pkg-config", @@ -4157,20 +4154,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libssh2-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - [[package]] name = "libz-sys" version = "1.1.22" @@ -4550,7 +4533,7 @@ dependencies = [ "libc", "log 0.4.34", "openssl", - "openssl-probe 0.2.1", + "openssl-probe", "openssl-sys", "schannel", "security-framework 3.5.1", @@ -5141,12 +5124,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - [[package]] name = "openssl-probe" version = "0.2.1" @@ -7431,7 +7408,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" dependencies = [ - "openssl-probe 0.2.1", + "openssl-probe", "rustls-pki-types", "schannel", "security-framework 3.5.1", diff --git a/crates/yaak-git/Cargo.toml b/crates/yaak-git/Cargo.toml index dc6f2389d..a297b24a2 100644 --- a/crates/yaak-git/Cargo.toml +++ b/crates/yaak-git/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] chrono = { workspace = true, features = ["serde"] } -git2 = { version = "0.20.4", features = ["vendored-libgit2", "vendored-openssl"] } +git2 = { version = "0.21.0", features = ["vendored-libgit2", "vendored-openssl"] } log = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } diff --git a/crates/yaak-git/src/log.rs b/crates/yaak-git/src/log.rs index 8b31f80b9..e5651a38b 100644 --- a/crates/yaak-git/src/log.rs +++ b/crates/yaak-git/src/log.rs @@ -74,11 +74,11 @@ fn git_log_inner(dir: &Path, rela_path: Option<&Path>) -> crate::error::Result Result { let repo = open_repo(dir)?; let branch_name = get_current_branch_name(&repo)?; let remote = get_default_remote_in_repo(&repo)?; - let remote_name = - remote.name().ok_or(GenericError("Failed to get remote name".to_string()))?.to_string(); - let remote_url = - remote.url().ok_or(GenericError("Failed to get remote url".to_string()))?.to_string(); + let remote_name = remote + .name()? + .ok_or(GenericError("Failed to get remote name".to_string()))? + .to_string(); + let remote_url = remote.url()?.to_string(); (branch_name, remote_name, remote_url) }; diff --git a/crates/yaak-git/src/push.rs b/crates/yaak-git/src/push.rs index d368a9f27..63225f2c1 100644 --- a/crates/yaak-git/src/push.rs +++ b/crates/yaak-git/src/push.rs @@ -23,10 +23,11 @@ pub async fn git_push(dir: &Path) -> Result { let repo = open_repo(dir)?; let branch_name = get_current_branch_name(&repo)?; let remote = get_default_remote_for_push_in_repo(&repo)?; - let remote_name = - remote.name().ok_or(GenericError("Failed to get remote name".to_string()))?.to_string(); - let remote_url = - remote.url().ok_or(GenericError("Failed to get remote url".to_string()))?.to_string(); + let remote_name = remote + .name()? + .ok_or(GenericError("Failed to get remote name".to_string()))? + .to_string(); + let remote_url = remote.url()?.to_string(); (branch_name, remote_name, remote_url) }; diff --git a/crates/yaak-git/src/remotes.rs b/crates/yaak-git/src/remotes.rs index 7b508e39a..f229fbc43 100644 --- a/crates/yaak-git/src/remotes.rs +++ b/crates/yaak-git/src/remotes.rs @@ -18,8 +18,8 @@ pub fn git_remotes(dir: &Path) -> Result> { for remote in repo.remotes()?.into_iter() { let name = match remote { - None => continue, - Some(name) => name, + Ok(Some(name)) => name, + _ => continue, }; let r = match repo.find_remote(name) { Ok(r) => r, @@ -28,7 +28,8 @@ pub fn git_remotes(dir: &Path) -> Result> { continue; } }; - remotes.push(GitRemote { name: name.to_string(), url: r.url().map(|u| u.to_string()) }); + remotes + .push(GitRemote { name: name.to_string(), url: r.url().ok().map(|u| u.to_string()) }); } Ok(remotes) diff --git a/crates/yaak-git/src/status.rs b/crates/yaak-git/src/status.rs index 6c4152ddb..ad3002e05 100644 --- a/crates/yaak-git/src/status.rs +++ b/crates/yaak-git/src/status.rs @@ -87,7 +87,7 @@ pub fn git_worktree_status(dir: &Path) -> crate::error::Result crate::error::Result { let (head_ref, head_ref_shorthand) = git_head_refs(repo); - let origins = repo.remotes()?.into_iter().filter_map(|o| Some(o?.to_string())).collect(); + let origins = repo.remotes()?.into_iter().filter_map(|o| Some(o.ok()??.to_string())).collect(); let local_branches = local_branch_names(repo)?; let remote_branches = remote_branch_names(repo)?; @@ -182,7 +182,7 @@ fn git_branch_info_for_repo( let (ahead, behind) = (|| -> Option<(usize, usize)> { let head = repo.head().ok()?; let local_oid = head.target()?; - let branch_name = head.shorthand()?; + let branch_name = head.shorthand().ok()?; let upstream_ref = repo.find_branch(&format!("origin/{branch_name}"), git2::BranchType::Remote).ok()?; let upstream_oid = upstream_ref.get().target()?; @@ -205,8 +205,8 @@ fn git_branch_info_for_repo( fn git_head_refs(repo: &git2::Repository) -> (Option, Option) { match repo.head() { Ok(head) => { - let head_ref = head.name().map(|s| s.to_string()); - let head_ref_shorthand = head.shorthand().map(|s| s.to_string()); + let head_ref = head.name().ok().map(|s| s.to_string()); + let head_ref_shorthand = head.shorthand().ok().map(|s| s.to_string()); (head_ref, head_ref_shorthand) } Err(_) => { diff --git a/crates/yaak-git/src/util.rs b/crates/yaak-git/src/util.rs index 6aa5c068f..a81f3c670 100644 --- a/crates/yaak-git/src/util.rs +++ b/crates/yaak-git/src/util.rs @@ -99,7 +99,7 @@ pub(crate) fn get_default_remote_name_in_repo(repo: &Repository) -> Result Result