Skip to main content

undo_edits

Function undo_edits 

Source
pub fn undo_edits(repo: &Repo, work_dir: &Path, before: &Snapshot) -> Snapshot
Expand description

Put the branch back where the review found it.

Nothing here was ever pushed: the loop pushes at the end of a round, so the head a review starts from is the head the pull request already has. What is discarded is therefore only what the review wrote after being told not to, and keeping it would hand the reviewer its own commit to review next round.

Returns the state afterwards, which equals before when the rollback took. The caller compares, because a rollback that did not take means the reviewer wrote the head and custody has to follow it there.