summaryrefslogtreecommitdiffstats
path: root/core/file.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-04 15:55:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-07 07:46:27 -0700
commitd8b92a18520a58646180e6b91cafd89dbb997fcb (patch)
tree419a18aad9bc9b957ab626f70086bd874867bbab /core/file.c
parent64a5f10cfe9bf82bcab3efc99961bd20cf602df9 (diff)
downloadsubsurface-d8b92a18520a58646180e6b91cafd89dbb997fcb.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/file.c')
-rw-r--r--core/file.c16
1 files changed, 0 insertions, 16 deletions
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);