Refactored GitRepoExists function