diff --git a/cli/build.rs b/cli/build.rs index 76feac9548..ec5119d762 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -44,8 +44,8 @@ fn main() -> std::io::Result<()> { } println!("cargo:rerun-if-env-changed=NIX_JJ_GIT_HASH"); - // TODO: timestamp can be "nix" - if let Some((git_hash, maybe_date)) = get_git_timestamp_and_hash() { + if let Some((mut git_hash, maybe_date)) = get_git_timestamp_and_hash() { + git_hash.truncate(16); println!( "cargo:rustc-env=JJ_VERSION={}-{}-{}", version, diff --git a/cli/tests/test_global_opts.rs b/cli/tests/test_global_opts.rs index 2d6223fb4d..fb6ad80ba1 100644 --- a/cli/tests/test_global_opts.rs +++ b/cli/tests/test_global_opts.rs @@ -48,9 +48,9 @@ fn test_version() { let sanitized = stdout.replace(|c: char| c.is_ascii_hexdigit(), "?"); let expected = [ "jj ?.??.?\n", - "jj ?.??.?-????????-????????????????????????????????????????\n", + "jj ?.??.?-????????-????????????????\n", // `dateunknown` turns into `??t?unknown` since d,a,e are hex digits. - "jj ?.??.?-??t?unknown-????????????????????????????????????????\n", + "jj ?.??.?-??t?unknown-????????????????\n", ]; assert!( expected.contains(&sanitized.as_str()),