fix(pull): match git no-upstream advice#424
Merged
Merged
Conversation
Signed-off-by: Eli Ma <eli@patch.sh>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates libra pull’s “no upstream / no tracking” failure path to match Git’s unprefixed advisory block (rather than an error: line), while preserving the existing stable error code (LBR-REPO-003) and exit code (128). It introduces a dedicated CliErrorKind variant to support Git-style unprefixed runtime failures and updates tests/docs/compat notes accordingly.
Changes:
- Add
CliErrorKind::UnprefixedFailure+CliError::unprefixed_failure(...)to render runtime advisory blocks withouterror:/fatal:prefixes. - Update
pull’s missing-tracking handling to emit Git-style advice, and to include the single configured remote name in--set-upstream-to=...when exactly one remote exists. - Update integration tests and documentation to reflect the new advisory output and compatibility behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/command/pull_test.rs | Tightens assertions for Git-style “no tracking” stderr and adds coverage for single-remote upstream advice. |
| src/utils/error.rs | Introduces UnprefixedFailure to support unprefixed Git-style runtime advisory rendering (plus unit test). |
| src/command/pull.rs | Emits Git-style no-tracking advice (merge vs rebase wording; single-remote hinting) instead of prefixed error + hints. |
| docs/development/commands/pull.md | Documents the Git-style advisory behavior and the single-remote substitution rule. |
| docs/commands/zh-CN/pull.md | Adds user-facing example + updates scenario table to describe advisory-block output. |
| docs/commands/pull.md | Adds user-facing example + updates scenario table to describe advisory-block output. |
| COMPATIBILITY.md | Notes the new Git-style no-upstream tracking advice behavior under pull. |
Comment on lines
+145
to
+149
| } | ||
|
|
||
| #[test] | ||
| #[serial] | ||
| fn test_pull_cli_without_tracking_uses_single_remote_in_advice() { |
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.
No description provided.