Fix git fetch; improve git error handling within agent