From 3c2965b15107e49aa0ff686987390bc896ee3407 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 5 Oct 2015 22:06:25 +0100 Subject: 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 --- git-access.c | 6 ++++-- 1 file 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) -- cgit v1.2.3-70-g09d2