summaryrefslogtreecommitdiffstats
path: root/save-git.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 /save-git.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 'save-git.c')
-rw-r--r--save-git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/save-git.c b/save-git.c
index 6e44b0851..64e04823b 100644
--- a/save-git.c
+++ b/save-git.c
@@ -1139,7 +1139,7 @@ int do_git_save(git_repository *repo, const char *branch, const char *remote, bo
if (create_new_commit(repo, branch, &id))
return report_error("creating commit failed");
- if (prefs.cloud_background_sync) {
+ if (remote && prefs.cloud_background_sync) {
/* now sync the tree with the cloud server */
if (strstr(remote, prefs.cloud_git_url)) {
return sync_with_remote(repo, remote, branch, RT_HTTPS);