summaryrefslogtreecommitdiff
path: root/src/builder.rs
diff options
context:
space:
mode:
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
}