Open BigSamu opened 11 months ago
Most likely fix is just gating the execSync
behind a "if the list isn't empty"
Also, would be nice to add D
to the diff filter: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203
I would like to work on this. Thanks!
Describe the bug
Reviewing the base code, I realised that when you commit new changes,
scripts/test-staged.js
only considers files that are Added, Copied, Modified or Renamed but never a Deleted. When trying to commit a change that only has a Delete, the variablestagedFiles
is an empty list (['']
) and then the testing command from jest with flag --findRelatedTests complains because no location is given.To Reproduce Steps to reproduce the behaviour:
Hello World
)git add .
andgit -sm "adding random txt file
)git add .
andgit -sm "adding random txt file
)Expected behavior
When committing you should not see an error from jest as described below
Error Message
Host/Environment (please complete the following information):