I have a pre-push script in .git/hooks that does the following:
git stash -u
<build / test>
git stash pop
However, if the working directory is clean, then git stash -u does nothing, and no stash is created. Then pop pops the previous stash item. Is there a way of forcing stash?
A workaround is to create a temp file, that I then delete to force there to be something to stash.