Refactored error checking on git diff output.