upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/lib/git/identify_ahead_behind.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-03-05 21:25:50 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-03-05 22:12:07 +0000
commitf6d1e03dc99b3ea48cb6e4bd1d3371dd924a567a (patch)
tree19fb789e83bd8d4ccc25f735a80cf41c0eccad17 /src/lib/git/identify_ahead_behind.rs
parent83b0886b97e2e90e328f91fcfaeb59726c93308f (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/lib/git/identify_ahead_behind.rs')
0 files changed, 0 insertions, 0 deletions