From d8b92a18520a58646180e6b91cafd89dbb997fcb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 4 Apr 2020 15:55:04 +0200 Subject: git: don't check for git sha in parse_file() parse_file() refused to load from a git repository if we already had that repository and there were no changes. However, this only checked the global divelist_changed flag, which does not track undo-commands. Thus, after editing dives the user couldn't reload from git. Remove this check. It is somewhat questionable that the io layer refuses to load from a repository anyway. Let the caller decide. There appears to be a check_git_sha function for that purpose(?). Signed-off-by: Berthold Stoeger --- core/file.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'core') diff --git a/core/file.c b/core/file.c index b4783f3fc..0fece03a9 100644 --- a/core/file.c +++ b/core/file.c @@ -12,7 +12,6 @@ #include "dive.h" #include "subsurface-string.h" -#include "divelist.h" #include "errorhelper.h" #include "file.h" #include "git-access.h" @@ -297,7 +296,6 @@ int parse_file(const char *filename, struct dive_table *table, struct trip_table { struct git_repository *git; const char *branch = NULL; - char *current_sha = copy_string(saved_git_id); struct memblock mem; char *fmt; int ret; @@ -308,22 +306,8 @@ int parse_file(const char *filename, struct dive_table *table, struct trip_table && git == dummy_git_repository) { /* opening the cloud storage repository failed for some reason * give up here and don't send errors about git repositories */ - free(current_sha); return -1; } - /* if this is a git repository, do we already have this exact state loaded ? - * get the SHA and compare with what we currently have */ - if (git && git != dummy_git_repository) { - const char *sha = get_sha(git, branch); - if (!empty_string(sha) && - same_string(sha, current_sha) && - !unsaved_changes()) { - fprintf(stderr, "already have loaded SHA %s - don't load again\n", sha); - free(current_sha); - return 0; - } - } - free(current_sha); if (git) return git_load_dives(git, branch, table, trips, sites); -- cgit v1.2.3-70-g09d2