fix bug in which git command error handling was broken

fix bug in which git command error handling was broken