Error handling of git operations is added

Closes bug 1240468

Change-Id: I747e64ef88c007c580c663ea045819241541ffb7