forge::retarget (crates/knotless/src/forge.rs, retarget, about line
1947) writes the base state record first, then handles head. The head
part can still fail: when the caller did not write the pull (only the author of <pull> can change its head), or when the head branch is missing
(<url> has no branch <head>). The call then returns an error, but the
new base is already written and stays.
How to see it
As a collaborator who did not write a pull, run knotless retarget <url> <pull> --base <other> --head <branch>. MCP retarget_pull does the same.
The command fails, yet the pull now points at the new base. The same thing
happens to the author when the head branch name is a typo.
What you expected
Either both parts land or neither does. Check the head, meaning
authorship and that the branch exists, before writing the base state.
Where
Code on main at b191acef. Found by the docs audit.
What happened
forge::retarget(crates/knotless/src/forge.rs,retarget, about line 1947) writes thebasestate record first, then handleshead. The head part can still fail: when the caller did not write the pull (only the author of <pull> can change its head), or when the head branch is missing (<url> has no branch <head>). The call then returns an error, but the new base is already written and stays.How to see it
As a collaborator who did not write a pull, run
knotless retarget <url> <pull> --base <other> --head <branch>. MCPretarget_pulldoes the same. The command fails, yet the pull now points at the new base. The same thing happens to the author when the head branch name is a typo.What you expected
Either both parts land or neither does. Check the head, meaning authorship and that the branch exists, before writing the base state.
Where
Code on main at b191acef. Found by the docs audit.
🤖 Generated with Claude Code