Fix git fetch for older versions of git

Review 1165 by @Tryneus