Merge from 4.2-dev: Check for existence of git before using it.