diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 21:25:50 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 22:12:07 +0000 |
| commit | f6d1e03dc99b3ea48cb6e4bd1d3371dd924a567a (patch) | |
| tree | 19fb789e83bd8d4ccc25f735a80cf41c0eccad17 /src/bin/git_remote_nostr/main.rs | |
| parent | 83b0886b97e2e90e328f91fcfaeb59726c93308f (diff) | |
fix(pr-checkout): require --force on diverged proposal branch
checkout_patch() previously re-applied the patch chain whenever the local
branch tip didn't match the published tip, silently overwriting local
amendments and rebased revisions without warning.
Now detects the relationship between local and published tips:
- up to date: check out as-is
- behind (local is ancestor of published): fast-forward, no flag needed
- local commits on top (published is ancestor of local): check out as-is
- diverged (neither ancestor): bail with guidance, --force to overwrite
- published tip not found locally and branch exists: same as diverged
Also adds --force flag to `ngit pr checkout` to explicitly opt in to
overwriting a diverged branch, covering both local amendments and
author force-pushes.
Bug discovered during test implementation in tests/ngit_pr_checkout.rs.
Diffstat (limited to 'src/bin/git_remote_nostr/main.rs')
0 files changed, 0 insertions, 0 deletions