mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
ee2e43f11a
commit
a29c4ddba3
2 changed files with 50 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue