aboutsummaryrefslogtreecommitdiffstats
path: root/git-access.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2015-06-16 17:37:15 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-16 21:40:31 -0700
commiteff3fd32618646a3777c4507b8d7fdf4aca2ba8c (patch)
tree9672e29ffdd54182eea30f3a67ebf1e8e2adfe7c /git-access.c
parenteca7d998e102ee10fc5a765a2b8d4a2176a5e2f5 (diff)
downloadsubsurface-eff3fd32618646a3777c4507b8d7fdf4aca2ba8c.tar.gz
git save: fix crash with no remote
Commit e21cae2d46db ("Cloud storage: sync the remote after save") broke regular git saving without any remotes: it would never initialize the "remote" pointer, and then use that uninitialized remote pointer to see if it was a cloud storage remote that it should try to sync. Fix it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'git-access.c')
-rw-r--r--git-access.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-access.c b/git-access.c
index 2d914ebfe..3a99d591c 100644
--- a/git-access.c
+++ b/git-access.c
@@ -568,6 +568,8 @@ struct git_repository *is_git_repository(const char *filename, const char **bran
free(branch);
return dummy_git_repository;
}
+ if (remote)
+ *remote = NULL;
*branchp = branch;
return repo;
}