From a29c4ddba32b59bfffaf08b5b8160f80e2e7dc2b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 19 Mar 2014 13:28:47 -0700 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui/mainwindow.cpp') 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; -- cgit v1.2.3-70-g09d2