Return the correct paths when is_git_repository() is called as dry_run

Otherwise we are creating the local git cache path with the remote
variable being uninitialized - which can cause crashes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-10-05 22:06:25 +01:00
parent c50fc04a82
commit 3c2965b151

View file

@ -857,9 +857,11 @@ struct git_repository *is_git_repository(const char *filename, const char **bran
return dummy_git_repository;
}
if (dry_run)
if (dry_run) {
*branchp = branch;
*remote = loc;
return dummy_git_repository;
}
repo = is_remote_git_repository(loc, branch);
if (repo) {
if (remote)