From 83bd46cf799bcacf9ce259571b911b86592564d3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 27 Dec 2015 08:31:08 -0800 Subject: Add option to not check the remote when loading from git storage This way we can first load from cache and then update from the network in the background. Signed-off-by: Dirk Hohndel --- subsurface-core/git-access.c | 5 +++++ subsurface-core/pref.h | 1 + 2 files changed, 6 insertions(+) (limited to 'subsurface-core') diff --git a/subsurface-core/git-access.c b/subsurface-core/git-access.c index 79e52b5a4..81952c89c 100644 --- a/subsurface-core/git-access.c +++ b/subsurface-core/git-access.c @@ -462,6 +462,11 @@ int sync_with_remote(git_repository *repo, const char *remote, const char *branc char *proxy_string; git_config *conf; + if (prefs.git_local_only) { + if (verbose) + fprintf(stderr, "don't sync with remote - read from cache only\n"); + return 0; + } if (verbose) fprintf(stderr, "sync with remote %s[%s]\n", remote, branch); diff --git a/subsurface-core/pref.h b/subsurface-core/pref.h index 348dcfbf2..1e58a6ace 100644 --- a/subsurface-core/pref.h +++ b/subsurface-core/pref.h @@ -125,6 +125,7 @@ struct preferences { short conservatism_level; int time_threshold; int distance_threshold; + bool git_local_only; }; enum unit_system_values { METRIC, -- cgit v1.2.3-70-g09d2