diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-15 06:05:00 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-15 10:22:00 -0700 |
commit | c593dea119b4c5fa77a8b2cc129d048d7d56afa4 (patch) | |
tree | 89e7e7105fb6d8d625f880e6b709cfe23e6d144a /git-access.c | |
parent | 617b105458f362516de9bf2997f747de5dc14e44 (diff) | |
download | subsurface-c593dea119b4c5fa77a8b2cc129d048d7d56afa4.tar.gz |
Cloud storage: use preference member instead of hard coded strings
This creates the basis to allow other backends to be used with the cloud
storage infrastructure.
So far this should all just transparently continue to work. A user would
have to manually add the cloud_base_url entry to the CloudStorage section
in their config file in order to use a different backend server.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'git-access.c')
-rw-r--r-- | git-access.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git-access.c b/git-access.c index 94f12c5ea..b86805994 100644 --- a/git-access.c +++ b/git-access.c @@ -374,12 +374,12 @@ static git_repository *create_local_repo(const char *localdir, const char *remot int len = sizeof("Reference 'refs/remotes/origin/' not found" + strlen(branch)); char *pattern = malloc(len); snprintf(pattern, len, "Reference 'refs/remotes/origin/%s' not found", branch); - if (strstr(remote, "https://cloud.subsurface-divelog.org/git") && strstr(msg, pattern)) { + if (strstr(remote, prefs.cloud_git_url) && strstr(msg, pattern)) { /* we're trying to open the remote branch that corresponds * to our cloud storage and the branch doesn't exist. * So we need to create the branch and push it to the remote */ cloned_repo = create_and_push_remote(localdir, remote, branch); - } else if (strstr(remote, "https://cloud.subsurface-divelog.org/git")) { + } else if (strstr(remote, prefs.cloud_git_url)) { report_error(translate("gettextFromC", "Error connecting to Subsurface cloud storage")); } else { report_error(translate("gettextFromC", "git clone of %s failed (%s)"), remote, msg); |