From 4b5dad9f3250ef67e7e2220e4414e59b21927451 Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Thu, 1 Sep 2022 16:48:34 +0200 Subject: [PATCH] src/main.rs: add silent umount before PreCo, Checkout, Commit and Mount --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 45a552c..7223584 100644 --- a/src/main.rs +++ b/src/main.rs @@ -167,6 +167,7 @@ fn main() { init::init_and_hook(init.hooks, &init.compression, &init.mode); } Commands::Commit(commit) => { + mount::umount_archive(true); if commit.revert { if commit.revert == commit.update { eprintln!("Error: You moust choose between --revert and --update option") @@ -182,9 +183,11 @@ fn main() { list::borg_list(list.first, list.last, &list.archive); } Commands::PreCo => { + mount::umount_archive(true); checkout::prepare_checkout(); } Commands::Checkout(co) => { + mount::umount_archive(true); checkout::checkout(&co.mode); } Commands::CreateHooks(ch) => { @@ -197,10 +200,11 @@ fn main() { create_hooks::delete_hooks(); } Commands::Mount(mount) => { + mount::umount_archive(true); mount::mount_archive(&mount.commit, &mount.path, mount.versions); } Commands::Umount => { - mount::umount_archive(); + mount::umount_archive(false); } } } -- GitLab