diff --git a/cli/src/diff_util.rs b/cli/src/diff_util.rs index c21b3f693..587dc67a6 100644 --- a/cli/src/diff_util.rs +++ b/cli/src/diff_util.rs @@ -638,7 +638,7 @@ fn git_diff_part( value: MaterializedTreeValue, ) -> Result { let mode; - let hash; + let mut hash; let mut contents: Vec; match value { MaterializedTreeValue::Absent => { @@ -693,7 +693,7 @@ fn git_diff_part( panic!("Unexpected tree in diff at path {path:?}"); } } - let hash = hash[0..10].to_string(); + hash.truncate(10); Ok(GitDiffPart { mode, hash,