summaryrefslogtreecommitdiffstats
path: root/save-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-20 06:45:12 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-20 06:45:12 -0700
commitde35c886837016c80fc65043d8a2f0b373efec5b (patch)
tree87eaf634a88f557d88d9580d5b5ad759f9e1ceeb /save-git.c
parent70d4421cd0ab235ee4f37ed7f8b6ad863da703bb (diff)
downloadsubsurface-de35c886837016c80fc65043d8a2f0b373efec5b.tar.gz
Track minimum datafile version
Add infrastructure and helper functions to track minimum datafile version. To make this information useful we need to keep the XML and git data format versions in track moving forward. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
-rw-r--r--save-git.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/save-git.c b/save-git.c
index e13847125..4e5ed38e0 100644
--- a/save-git.c
+++ b/save-git.c
@@ -11,6 +11,7 @@
#include <git2.h>
#include "dive.h"
+#include "divelist.h"
#include "device.h"
#include "membuffer.h"
#include "git-access.h"
@@ -832,13 +833,11 @@ static void save_one_device(void *_b, const char *model, uint32_t deviceid,
put_string(b, "\n");
}
-#define VERSION 3
-
static void save_settings(git_repository *repo, struct dir *tree)
{
struct membuffer b = { 0 };
- put_format(&b, "version %d\n", VERSION);
+ put_format(&b, "version %d\n", DATAFORMAT_VERSION);
save_userid(&b);
call_for_each_dc(&b, save_one_device, false);
cond_put_format(autogroup, &b, "autogroup\n");