Skip to content

fix(deps): update git2 to 0.21#337

Merged
mrmans0n merged 1 commit into
mainfrom
nacho/git2-0.21
May 19, 2026
Merged

fix(deps): update git2 to 0.21#337
mrmans0n merged 1 commit into
mainfrom
nacho/git2-0.21

Conversation

@mrmans0n
Copy link
Copy Markdown
Owner

Summary

  • Bump git2 from 0.20 to 0.21 across gg-core and gg-mcp.
  • 0.21 changed many string accessors from Option<&str> to Result<&str, Error> / Result<Option<&str>, Error> (see git2-rs#1241); update ~11 call sites with .ok() / .ok().flatten() to preserve existing semantics. Non-UTF-8 branch/commit names aren't a meaningful case for this tool.
  • Drop the ssh/https/cred default features (no longer default upstream). All network operations in this repo use subprocess git/gh/glab; git2 is only used for local repo inspection, so transport features are unused.
  • Replace deprecated Oid::zero() with the Oid::ZERO_SHA1 constant (11 sites).

Supersedes #336 (renovate's version-only bump, which didn't update call sites).

Test plan

  • cargo fmt --all
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features — 229 pass; 1 pre-existing failure (squash::test_squash_requires_stack) confirmed unrelated by running on the unmodified branch.

🤖 Generated with Claude Code

git2 0.21 changed many string accessors from `Option<&str>` to
`Result<&str, Error>` / `Result<Option<&str>, Error>` so callers can
distinguish a missing value from a non-UTF-8 one. Adapt the call sites
with `.ok()` / `.ok().flatten()` to preserve existing behavior; non-UTF-8
branch/commit names aren't a meaningful case for this tool's domain.

Also drop the `ssh`/`https`/`cred` default features (no longer default
upstream) since this crate only uses git2 for local operations, and
replace deprecated `Oid::zero()` with the `Oid::ZERO_SHA1` constant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented May 19, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mrmans0n mrmans0n merged commit 1b80486 into main May 19, 2026
10 checks passed
@mrmans0n mrmans0n deleted the nacho/git2-0.21 branch May 19, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant