summaryrefslogtreecommitdiffstats
path: root/load-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-29 12:58:16 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-29 12:58:16 -0400
commitedac07554c50a693389e4d88a6d6f56820c940f1 (patch)
tree4926b2f0b2e846690f1270265d60f61856d9bffc /load-git.c
parent7ad1485c398b8bea651e28acb5eed2c78ff8a18e (diff)
downloadsubsurface-edac07554c50a693389e4d88a6d6f56820c940f1.tar.gz
Make sure we don't create multiple dive sites with the same uuid
This shouldn't happen, but in case there is a logic error higher up in the code somewhere, this will prevent it from happening, period. If the code asks for a new dive site with a specific uuid, simply return the existing dive site with that uuid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'load-git.c')
-rw-r--r--load-git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/load-git.c b/load-git.c
index d50a53d6c..8c7df7bcc 100644
--- a/load-git.c
+++ b/load-git.c
@@ -1444,7 +1444,7 @@ static int parse_site_entry(git_repository *repo, const git_tree_entry *entry, c
if (*suffix == '\0')
return report_error("Dive site without uuid");
uint32_t uuid = strtoul(suffix, NULL, 16);
- struct dive_site *ds = alloc_dive_site(uuid);
+ struct dive_site *ds = alloc_or_get_dive_site(uuid);
git_blob *blob = git_tree_entry_blob(repo, entry);
if (!blob)
return report_error("Unable to read dive site file");