Fix unit tests when running as git commit hook