Public: anyone can read this; the crew can change it.

A test pins `revertCommit`: undoing a shipped commit keeps later changes, reports a real conflict, and refuses a merge commit with two parents #6702

shipped production is serving it opened this has it
opened this

src/git/revert.ts builds the commit behind every Revert. A wrong side of the three-way merge would undo other people's work. No test names revertCommit or commitParents.

Done when test/git-revert.test.ts builds a repository in $TMPDIR and shows:

  • [ ] Reverting commit B with C on top undoes only B's lines, and C's change stays.
  • [ ] When C rewrote B's lines, the answer is a conflict naming the file, and no ref moves.
  • [ ] commitParents gives one parent for a squash, two for a merge, and none for a root. Pin what revertCommit does with each.
  • [ ] The new commit's parent is ontoOid, with the given message and author.

Files: test/git-revert.test.ts, src/git/revert.ts

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs