mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Don't reload identical data
If we already have the same SHA loaded and no changes have been made to the dive list then there is no point in loading the dives again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bc200c3089
commit
8c1cc4524d
1 changed files with 9 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "dive.h"
|
#include "dive.h"
|
||||||
|
#include "divelist.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "git-access.h"
|
#include "git-access.h"
|
||||||
#include "qthelperfromc.h"
|
#include "qthelperfromc.h"
|
||||||
|
@ -447,6 +448,14 @@ int parse_file(const char *filename)
|
||||||
* give up here and don't send errors about git repositories */
|
* give up here and don't send errors about git repositories */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* do we already have this exact state loaded ?
|
||||||
|
* get the SHA and compare with what we currently have */
|
||||||
|
const char * sha = get_sha(git, branch);
|
||||||
|
if (same_string(sha, saved_git_id) && !unsaved_changes()) {
|
||||||
|
fprintf(stderr, "already have loaded SHA %s - don't load again\n", sha);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (git && !git_load_dives(git, branch))
|
if (git && !git_load_dives(git, branch))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue