From 9b342d7de938fe3fe7a38f26739ee4b663790f31 Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Wed, 15 May 2024 11:17:05 +0200 Subject: [PATCH] src/clone.rs: update clone to avoid a borg init before cheking if the remote path is ok --- src/clone.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clone.rs b/src/clone.rs index 5a564a6..4d0e9cc 100644 --- a/src/clone.rs +++ b/src/clone.rs @@ -54,7 +54,7 @@ pub fn get_borg_absolute_folder() -> PathBuf { p } -/// Check if the input remote dir +/// Check if the input remote dir contains archives defined in git history fn check_remote_dir(url: &PathBuf, adress: &str) { let archives = pull::get_archive_list(&url, &adress); if archives.len() == 0 { @@ -65,6 +65,8 @@ fn check_remote_dir(url: &PathBuf, adress: &str) { ); exit(1); } + let git_commits = pull::get_git_commits(); + pull::check_archives(&git_commits, &archives); } /// Create a push the tar achive on the selected remote path -- GitLab