From 192314852ca3e3f5effd921740c5c72d53f67e4d Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Wed, 11 May 2022 10:56:57 +0200
Subject: [PATCH] src/commit.rs: add a parameter commit to the commit function

---
 src/commit.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/commit.rs b/src/commit.rs
index 2ca56a4..bf677fe 100644
--- a/src/commit.rs
+++ b/src/commit.rs
@@ -37,9 +37,11 @@ pub fn get_current_commit() -> String {
 }
 
 /// Create a commit of the results folder named as the current git commit id
-pub fn commit(compression: String) {
+pub fn commit(compression: String, mut commit: String) {
     let (borg_folder, results_folder) = check_path();
-    let commit = get_current_commit();
+    if commit == String::from("") {
+        commit = get_current_commit();
+    }
     let output = Command::new("borg")
         .arg("create")
         .arg("--stats")
-- 
GitLab