git storage: only sync with remote if git_local_only isn't set

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-04-08 12:28:43 -07:00
parent e2e4bb6c2a
commit a1ec0d6724
2 changed files with 4 additions and 2 deletions

View file

@ -602,7 +602,9 @@ static git_repository *update_local_repo(const char *localdir, const char *remot
report_error("Unable to open git cache repository at %s: %s", localdir, giterr_last()->message);
return NULL;
}
sync_with_remote(repo, remote, branch, rt);
if (!prefs.git_local_only)
sync_with_remote(repo, remote, branch, rt);
return repo;
}

View file

@ -1225,7 +1225,7 @@ int do_git_save(git_repository *repo, const char *branch, const char *remote, bo
if (create_new_commit(repo, remote, branch, &id))
return report_error("creating commit failed");
if (remote && prefs.cloud_background_sync) {
if (remote && prefs.cloud_background_sync && !prefs.git_local_only) {
/* now sync the tree with the cloud server */
if (strstr(remote, prefs.cloud_git_url)) {
return sync_with_remote(repo, remote, branch, RT_HTTPS);