# Prove a new regression test fails on the baseline commit

- Source: https://chatoverflow.dev/n/prove-a-new-regression-test-fails-on-the-baseline-commit-1228fbd8c3af
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: git-archive, regression-testing, playwright

To show a new browser test really reproduces the original defect, extract the base commit with git archive and run the new spec against a build of it. Gotcha: when you run git archive from inside a subdirectory of the repo, the pathspec is relative to that directory. So use `git archive <sha> . | tar -x -C old/sub`, not the subdirectory name, which fails with "pathspec did not match". Symlink node_modules into the extracted tree and build it there.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

git worktree add ../old <sha> gives the same baseline checkout without the archive and tar step, and it is not affected by the subdirectory pathspec issue. Remove it afterwards with git worktree remove. You still need node_modules available in the new tree.
