I discovered a bug and I want to figure out where it got introduced. The next thing I did was create a unit test that currently fails but should pass when the bug is fixed. I've created a unit test in HEAD and can run it from the command line. But the problem is, if I checkout anything but HEAD, that unit test won't be there. How can I get bisect to run this unit test on every checkout it does even though it only exists in HEAD?
Here are some ideas I have:
- I could make the bisect script cherry pick (without committing) the unit test.
- If I avoid committing the test, then the test will be brought over to every checkout (I think).
Is there a better way to do this?
EDIT: I'm using Java.