summaryrefslogtreecommitdiff
path: root/src/builder.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-01-16 10:02:03 +0000
committerLars Wirzenius <liw@liw.fi>2022-01-16 10:02:03 +0000
commit93584ec7e8b774c19d6b9c2ebc64a4513a961d96 (patch)
tree7ff13c1cd7e04b47a6aa20c22953605bcb05d34e /src/builder.rs
parent1ad4e5d867cf9b040de48371cce55bdb3ad001ea (diff)
parent8c799a2161d57f1b0f965ade59a8b7e690660cbe (diff)
downloadobnam-benchmark-93584ec7e8b774c19d6b9c2ebc64a4513a961d96.tar.gz
Merge branch 'fix-version-column' into 'main'
feat: allow report to write to named file See merge request obnam/obnam-benchmark!13
Diffstat (limited to 'src/builder.rs')
-rw-r--r--src/builder.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/builder.rs b/src/builder.rs
index 2de2085..ac414c7 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -4,7 +4,6 @@ use std::str::FromStr;
use tempfile::{tempdir, TempDir};
const OBNAM_URL: &str = "https://gitlab.com/obnam/obnam.git";
-const COMMIT_DIGITS: usize = 7;
#[derive(Debug, Clone)]
pub enum WhichObnam {
@@ -73,7 +72,7 @@ impl ObnamBuilder {
tempdir,
client,
server,
- commit: Some(commit[..COMMIT_DIGITS].to_string()),
+ commit: Some(commit),
}
}
};
@@ -81,10 +80,6 @@ impl ObnamBuilder {
}
pub fn version(&self) -> Result<String, ObnamBuilderError> {
- if let Some(commit) = &self.commit {
- return Ok(commit.to_string());
- }
-
let binary = self.client_binary();
let output = Command::new(binary)
.arg("--version")
@@ -101,6 +96,10 @@ impl ObnamBuilder {
Ok(v)
}
+ pub fn commit(&self) -> Option<String> {
+ self.commit.clone()
+ }
+
pub fn client_binary(&self) -> &Path {
&self.client
}