summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-19 13:28:47 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-19 14:32:27 -0700
commita29c4ddba32b59bfffaf08b5b8160f80e2e7dc2b (patch)
tree0f37ade98215cf203f6086c6193538fed21b850c /qt-ui
parentee2e43f11aedf615df0f21a8fc32e8fe6bc9782c (diff)
downloadsubsurface-a29c4ddba32b59bfffaf08b5b8160f80e2e7dc2b.tar.gz
git object store: make it possible to work with checked-out git branches
This makes the git object save logic also check out the changes in the working tree and index if the branch we save to is checked out. It used to be that we would just update the object store (and the branch ref, of course), but leave any checked-out state untouched. Note that if the working directory is dirty (ie you have made changes by hand and not committed them), the checkout will skip any dirty files and report it as a warning to the user. However, the save still succeeds (since the _real_ save goes to the backing store). NOTE NOTE NOTE! Both loading and saving very fundamentally work on the git object store level, and if you are working with a checked-out branch and make modifications to the working tree, saving will not touch those dirty files (so that you can try to recover your edits manually in the working tree), but it's worth pointing out that subsufrace loading state will totally ignore the working tree. So the only way to make subsurface *see* your changes is to commit them. Having edited state checked out in the working tree will only confuse you when subsurface first ignores it on reading, and then refuses to touch the checked-out state on writing. Put another way: working with a checked-out branch is now _possible_, but you need to be aware of the limitations. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index b66ef997a..8fd51a5b9 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -909,6 +909,7 @@ int MainWindow::file_save_as(void)
return -1;
}
+ showError(get_error_string());
set_filename(filename.toUtf8().data(), true);
setTitle(MWTF_FILENAME);
mark_divelist_changed(false);
@@ -938,6 +939,7 @@ int MainWindow::file_save(void)
showError(get_error_string());
return -1;
}
+ showError(get_error_string());
mark_divelist_changed(false);
addRecentFile(QStringList() << QString(existing_filename));
return 0;