Don't read git files if they are unreadable.

Also print warnings if the file is not readable. Fixes #1585.