Easy example, consider a stack with three PRs in it (main <- PR 1 <- PR 2 <- PR 3)
Say you take the changes from PR 3 and flatten them into PR 2 (or whatever upstream PR):
- GitHub will mark the PR as merged (because it transitioned to no diff)
- running
av sync erroneously thinks all PRs in the stack are now merged (puts mergeCommit into their state, though pullRequest.state is still OPEN), and tries to clean them up and truncates the rest of the stack
Workaround: ctrl-c ASAP to stop it from cleaning your branches/PRs up, and then:
- remove the
mergeCommit state from .git/av/av.db for all the branches that shouldn't be flagged merged.
- remove the merged PR completely from state; or this will reoccur