Add error handling for git operations

Change-Id: Iefd36bf3e2fe44838c392f2ba586b530e909efd5
Merge "Add error handling for git operations"