refactor: migrate commit_all and create_evolution_backup staging to git2, kill git_command wrapper#319
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
commit_all and create_evolution_backup staging to git2, kill git_command wrapper
📋 PR Overview
🔬 Coverage
|
There was a problem hiding this comment.
Pull request overview
This PR completes the migration away from the GitCommand CLI wrapper by porting commit_all (and the staging portion of create_evolution_backup) to git2/libgit2, aligning git mutations around repository object/index operations rather than shelling out to git.
Changes:
- Removed the
GitCommand/git_command()CLI wrapper from the git execution layer. - Added a shared
stage_all()helper that emulatesgit add -Ausing git2 index operations, and used it incommit_allandcreate_evolution_backup. - Added unit tests covering commit identity, staging semantics (including ignored/untracked/tracked deletions), nested-directory invocation behavior, and hook non-execution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/native/src-tauri/src/git/query.rs | Minor doc/comment adjustment in query-layer ref/HEAD resolution notes. |
| apps/native/src-tauri/src/git/exec.rs | Migrates commit_all + backup staging to git2 via stage_all(), removes CLI wrapper, and adds targeted unit tests for prior CLI semantics. |
8513b94 to
fc3c5dc
Compare
a31d2e5 to
659971d
Compare
659971d to
3fda913
Compare
fc3c5dc to
04ba33e
Compare
3fda913 to
257b0fe
Compare
04ba33e to
0896d06
Compare
257b0fe to
4f6c086
Compare
|
🙌 |

Summary
This is the last change before we can get rid of the
GitCommandCLI wrapper struct, namely to portcommit_allover to git2. The biggest change was in staging, so that gets is own helper. Added several unit tests to verify the previous behavior provided by flags in the old CLI command implementation (around signing, names, hooks).Test Plan
Existing and new unit tests pass.
Docs