aboutsummaryrefslogtreecommitdiffstats
path: root/save-xml.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-13 15:42:45 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-13 20:48:31 -0700
commit3fe0019bc2939aea4e89cbb8bc5aeb5edeb456d9 (patch)
treecbd3b2b6fa7f2b31977256f1e909920ebe916840 /save-xml.c
parent0b114a198eb3a648c507bc801a0343bf04dc0191 (diff)
downloadsubsurface-3fe0019bc2939aea4e89cbb8bc5aeb5edeb456d9.tar.gz
git object format: make sure parenthood isn't lost when saving
This makes subsurface remember the git source commit of the dive data. If you save to an existing branch, subsurface will now complain and refuse to save if you try to save if the existing branch is not related to the original source. That would destroy the history of the dive data, which in turn would make it impossible to do sane merging of the data. If you save to a new branch, it will see if the previous parent commit is known in the repository you are saving to, and will save parenthood information if so. Otherwise it will save it as a new parentless commit ("root commit" in git parlance). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r--save-xml.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/save-xml.c b/save-xml.c
index a27dcfa76..ef7396bf9 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -601,8 +601,11 @@ void save_dives_logic(const char *filename, const bool select_only)
const char *branch;
git = is_git_repository(filename, &branch);
- if (git && !git_save_dives(git, branch, select_only))
+ if (git) {
+ /* error returns, anybody? */
+ git_save_dives(git, branch, select_only);
return;
+ }
try_to_backup(filename);