What are scenarios in which 'git stash' might fail?

Viewed 162

I am writing a script to check that my git repository submodules are 'clean' and checked out to the reference commit, before archiving the entire project for deployment.

I'm using python 2.7 with gitpython and if the submodule repository is dirty, I call stash with no aditional arguments to prevent the user from losing their changes. I have never faced a failure with that command, but for the sake of good practices I added a try...except clause to catch possible errors.

My problem is that I cannot come up with something that will cause git stash to fail in order to test the clause. I tried changing the ownership of one of the altered files to root, but stashing worked anyway.

Is there anything that might cause a simple stash operation to fail?

1 Answers
Related