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

A test pins discarding a change in the local terminal: `d` asks first, and cancelling keeps the file byte for byte #7066

shipped production is serving it opened this has it
opened this

d on the working tree (src/tui/local/work.ts) discards through git.discardPath after confirmScreen. No test presses it.

Done:

  • [ ] A new test changes a tracked file and presses d on it. A confirm names the path. Escape leaves the file byte for byte as it was.
  • [ ] Confirming restores the committed content, and the row leaves the changed section.
  • [ ] On a half-staged path, discard drops only the unstaged half; the staged half stays staged.
  • [ ] With the cursor on no row, d is disabled and does nothing.

Files: test/tui-local-discard.test.ts

The test drives createLocalApp (src/tui/local/app.ts) over a real temporary repository, as test/tui-local.test.ts does. If it finds the behaviour wrong, fix the screen in the same pull and say so. If the check fails in a test this pull does not touch, name it in the pull rather than widening the change.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs