From e87ad6d60ccedad8ccda73eb1925671588fd6640 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 16 Feb 2022 13:11:46 -0600 Subject: [PATCH] helix-term build: check git hash length --- helix-term/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-term/build.rs b/helix-term/build.rs index 21dd5612dbdbd..33f2044acdc80 100644 --- a/helix-term/build.rs +++ b/helix-term/build.rs @@ -6,7 +6,8 @@ fn main() { .args(&["rev-parse", "HEAD"]) .output() .ok() - .and_then(|x| String::from_utf8(x.stdout).ok()); + .and_then(|x| String::from_utf8(x.stdout).ok()) + .filter(|hash| hash.len() >= 8); let version: Cow<_> = match git_hash { Some(git_hash) => format!("{} ({})", env!("CARGO_PKG_VERSION"), &git_hash[..8]).into(),