Added t4096 - refactor should work if gitignore unchanged.

By always writing out the .gitignore file, we would change its mtime, which causes a database update that gets flagged by the refactor. Since we already check for added/removed outputs, the .gitignore file should be unchanged by a refactor, so we don't need to write it out again.