fix(reset): address review and self-runner test failures#432
Merged
genedna merged 3 commits intoJul 6, 2026
Conversation
Signed-off-by: Quanyi Ma <eli@patch.sh>
Signed-off-by: Quanyi Ma <eli@patch.sh>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes two regressions impacting reliability and Git-compat CLI behavior: (1) unit tests for cloud object restore now run inside an isolated Libra repo/CWD so they don’t depend on the runner’s checkout context, and (2) libra reset -- <pathspec> rewrites now preserve the user-provided -- separator so dash-prefixed filenames remain pathspecs (not flags/help).
Changes:
- Preserve
--when rewritinglibra reset -- <pathspec>argv so-h/--helpcan be treated as filenames after the separator. - Add an integration regression test covering dash-prefixed pathspecs passed after
--. - Stabilize cloud restore unit tests by entering an isolated repo + HOME/LIBRA_TEST_HOME context and running these env/CWD-mutating tests under
#[serial].
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/command/reset_test.rs |
Adds regression coverage ensuring reset -- <dash-prefixed> is treated as a pathspec and unstages correctly. |
src/command/cloud.rs |
Adds a test helper to enter an isolated Libra repo/CWD + HOME context; marks affected async tests #[serial] to avoid cross-test interference. |
src/cli.rs |
Fixes reset argv rewriting to re-insert -- before forwarding the original post-separator pathspecs. |
Signed-off-by: Quanyi Ma <eli@patch.sh>
7b6660a
into
codex/reset-bare-path-git-compat
5 of 6 checks passed
genedna
added a commit
that referenced
this pull request
Jul 6, 2026
* fix(reset): support git-style bare path reset Signed-off-by: Quanyi Ma <eli@patch.sh> * fix(reset): address review and self-runner test failures (#432) * test(cloud): isolate restore object tests from cwd Signed-off-by: Quanyi Ma <eli@patch.sh> * fix(reset): preserve separator for dash-prefixed paths Signed-off-by: Quanyi Ma <eli@patch.sh> * test(file): avoid sqlite3 binary in obliterate recovery Signed-off-by: Quanyi Ma <eli@patch.sh> --------- Signed-off-by: Quanyi Ma <eli@patch.sh> * fix(reset): tighten reset target disambiguation Signed-off-by: Quanyi Ma <eli@patch.sh> * test(network): refresh public GitHub fixture --------- Signed-off-by: Quanyi Ma <eli@patch.sh>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
compat-offline-corefailure by giving the cloud object-restore unit tests an isolated Libra repo/current-directory context before they call restore logic that checks obliteration tombstones.--separator when rewritinglibra reset -- <pathspec>args, so dash-prefixed filenames like-hand--helpremain pathspecs instead of flags/help.Why
The cloud tests were assuming the process cwd was already a Libra repository. That is false in GitHub Actions self-hosted runner checkouts, which are ordinary Git worktrees. The reset rewrite also dropped clap's positional separator, changing parsing for dash-prefixed pathspecs.
Checks
cargo +nightly fmt --all --checkLIBRA_SKIP_WEB_BUILD=1 cargo test --test command_test command::reset_test::reset_ -- --nocaptureLIBRA_SKIP_WEB_BUILD=1 cargo test --lib cloud_restore_indexed_objects -- --nocapturecargo clippy --all-targets --all-features -- -D warningsNote: this PR is stacked on #431 (
codex/reset-bare-path-git-compat) so it only contains the two follow-up fixes.