mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cloudstorage: some cleanup of cloud url handling
We know the preference is never empty, so stop testing for this. But don't maintain two different preferences with basically the same content. Instead add the '/git' suffix where needed and keep this all in one place. Simplify the extraction of the branch name from the cloud URL. Also a typo fix and a new comment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
da6395a4a8
commit
c5eb806adb
12 changed files with 14 additions and 41 deletions
10
core/file.c
10
core/file.c
|
@ -284,9 +284,7 @@ int check_git_sha(const char *filename, struct git_repository **git_p, const cha
|
|||
*git_p = git;
|
||||
if (branch_p)
|
||||
*branch_p = branch;
|
||||
if (prefs.cloud_git_url &&
|
||||
strstr(filename, prefs.cloud_git_url)
|
||||
&& git == dummy_git_repository) {
|
||||
if (strstr(filename, prefs.cloud_base_url) && git == dummy_git_repository) {
|
||||
/* opening the cloud storage repository failed for some reason,
|
||||
* so we don't know if there is additional data in the remote */
|
||||
free(current_sha);
|
||||
|
@ -317,13 +315,11 @@ int parse_file(const char *filename, struct dive_table *table, struct trip_table
|
|||
int ret;
|
||||
|
||||
git = is_git_repository(filename, &branch, NULL, false);
|
||||
if (prefs.cloud_git_url &&
|
||||
strstr(filename, prefs.cloud_git_url)
|
||||
&& git == dummy_git_repository) {
|
||||
if (strstr(filename, prefs.cloud_base_url) && git == dummy_git_repository)
|
||||
/* opening the cloud storage repository failed for some reason
|
||||
* give up here and don't send errors about git repositories */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (git)
|
||||
return git_load_dives(git, branch, table, trips, sites, devices, filter_presets);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue