diff options
| author | David Tolnay <dtolnay@gmail.com> | 2024-08-05 08:17:18 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2024-08-05 08:17:18 -0700 |
| commit | 9f6536ce6f51f05091995c3ec7c4a308e8148c8d (patch) | |
| tree | 6d09e8c9b9d5ef3de696eeaaccdd211ee3cc2868 | |
| parent | c082bc2cb85313901ed3565fcd285592ed93df0f (diff) | |
| download | rust-9f6536ce6f51f05091995c3ec7c4a308e8148c8d.tar.gz rust-9f6536ce6f51f05091995c3ec7c4a308e8148c8d.zip | |
Use a deterministic number of digits in rustc_tools_util commit hashes
| -rw-r--r-- | rustc_tools_util/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rustc_tools_util/src/lib.rs b/rustc_tools_util/src/lib.rs index f8b8084ca1a..95e01576088 100644 --- a/rustc_tools_util/src/lib.rs +++ b/rustc_tools_util/src/lib.rs @@ -104,10 +104,11 @@ impl std::fmt::Debug for VersionInfo { #[must_use] pub fn get_commit_hash() -> Option<String> { let output = std::process::Command::new("git") - .args(["rev-parse", "--short", "HEAD"]) + .args(["rev-parse", "HEAD"]) .output() .ok()?; - let stdout = output.status.success().then_some(output.stdout)?; + let mut stdout = output.status.success().then_some(output.stdout)?; + stdout.truncate(10); String::from_utf8(stdout).ok() } |
