Fix crash when a git command fails.