Skip to content
Snippets Groups Projects
Commit 4b5dad9f authored by nfontrod's avatar nfontrod
Browse files

src/main.rs: add silent umount before PreCo, Checkout, Commit and Mount

parent ee2dd78a
Branches
No related tags found
No related merge requests found
...@@ -167,6 +167,7 @@ fn main() { ...@@ -167,6 +167,7 @@ fn main() {
init::init_and_hook(init.hooks, &init.compression, &init.mode); init::init_and_hook(init.hooks, &init.compression, &init.mode);
} }
Commands::Commit(commit) => { Commands::Commit(commit) => {
mount::umount_archive(true);
if commit.revert { if commit.revert {
if commit.revert == commit.update { if commit.revert == commit.update {
eprintln!("Error: You moust choose between --revert and --update option") eprintln!("Error: You moust choose between --revert and --update option")
...@@ -182,9 +183,11 @@ fn main() { ...@@ -182,9 +183,11 @@ fn main() {
list::borg_list(list.first, list.last, &list.archive); list::borg_list(list.first, list.last, &list.archive);
} }
Commands::PreCo => { Commands::PreCo => {
mount::umount_archive(true);
checkout::prepare_checkout(); checkout::prepare_checkout();
} }
Commands::Checkout(co) => { Commands::Checkout(co) => {
mount::umount_archive(true);
checkout::checkout(&co.mode); checkout::checkout(&co.mode);
} }
Commands::CreateHooks(ch) => { Commands::CreateHooks(ch) => {
...@@ -197,10 +200,11 @@ fn main() { ...@@ -197,10 +200,11 @@ fn main() {
create_hooks::delete_hooks(); create_hooks::delete_hooks();
} }
Commands::Mount(mount) => { Commands::Mount(mount) => {
mount::umount_archive(true);
mount::mount_archive(&mount.commit, &mount.path, mount.versions); mount::mount_archive(&mount.commit, &mount.path, mount.versions);
} }
Commands::Umount => { Commands::Umount => {
mount::umount_archive(); mount::umount_archive(false);
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment