mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-19 19:08:08 +00:00
diff_util: don't panic for file hashes < 10 hex chars
This commit is contained in:
parent
9fb5307b78
commit
539edad216
1 changed files with 2 additions and 2 deletions
|
@ -638,7 +638,7 @@ fn git_diff_part(
|
|||
value: MaterializedTreeValue,
|
||||
) -> Result<GitDiffPart, DiffRenderError> {
|
||||
let mode;
|
||||
let hash;
|
||||
let mut hash;
|
||||
let mut contents: Vec<u8>;
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue