diff --git a/core/file.c b/core/file.c index b8ea5fb75..ad3181ff7 100644 --- a/core/file.c +++ b/core/file.c @@ -273,7 +273,7 @@ static int parse_file_buffer(const char *filename, struct memblock *mem, struct return parse_xml_buffer(filename, mem->buffer, mem->size, table, trips, sites, devices, filter_presets, NULL); } -bool check_git_sha(const char *filename, struct git_info *info) +bool remote_repo_uptodate(const char *filename, struct git_info *info) { char *current_sha = copy_string(saved_git_id); @@ -282,14 +282,14 @@ bool check_git_sha(const char *filename, struct git_info *info) if (!empty_string(sha) && same_string(sha, current_sha)) { fprintf(stderr, "already have loaded SHA %s - don't load again\n", sha); free(current_sha); - return false; + return true; } } // Either the repository couldn't be opened, or the SHA couldn't // be found. free(current_sha); - return true; + return false; } int parse_file(const char *filename, struct dive_table *table, struct trip_table *trips, struct dive_site_table *sites, diff --git a/core/git-access.h b/core/git-access.h index 9f36dd995..56885ee00 100644 --- a/core/git-access.h +++ b/core/git-access.h @@ -40,7 +40,7 @@ struct git_info { extern bool is_git_repository(const char *filename, struct git_info *info); extern bool open_git_repository(struct git_info *info); -extern bool check_git_sha(const char *filename, struct git_info *info); +extern bool remote_repo_uptodate(const char *filename, struct git_info *info); extern int sync_with_remote(struct git_info *); extern int git_save_dives(struct git_info *, bool select_only); extern int git_load_dives(struct git_info *, struct dive_table *table, struct trip_table *trips, diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 1835a7d8e..5e33df0c3 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -737,7 +737,7 @@ void QMLManager::loadDivesWithValidCredentials() struct git_info info; int error; - if (check_git_sha(fileNamePrt.data(), &info) == 0) { + if (remote_repo_uptodate(fileNamePrt.data(), &info)) { appendTextToLog("Cloud sync shows local cache was current"); } else { appendTextToLog("Cloud sync brought newer data, reloading the dive list");