diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-10-05 22:06:25 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-06 00:01:29 +0100 |
commit | 3c2965b15107e49aa0ff686987390bc896ee3407 (patch) | |
tree | c4d31261618096161abec5cfa17dc0c300263c4a /git-access.c | |
parent | c50fc04a825a009f107f798a47463e8a45fa5927 (diff) | |
download | subsurface-3c2965b15107e49aa0ff686987390bc896ee3407.tar.gz |
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>
Diffstat (limited to 'git-access.c')
-rw-r--r-- | git-access.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git-access.c b/git-access.c index eee066007..d2be2c9d0 100644 --- a/git-access.c +++ b/git-access.c @@ -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) |