mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-07 21:27:06 +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,
|
value: MaterializedTreeValue,
|
||||||
) -> Result<GitDiffPart, DiffRenderError> {
|
) -> Result<GitDiffPart, DiffRenderError> {
|
||||||
let mode;
|
let mode;
|
||||||
let hash;
|
let mut hash;
|
||||||
let mut contents: Vec<u8>;
|
let mut contents: Vec<u8>;
|
||||||
match value {
|
match value {
|
||||||
MaterializedTreeValue::Absent => {
|
MaterializedTreeValue::Absent => {
|
||||||
|
@ -693,7 +693,7 @@ fn git_diff_part(
|
||||||
panic!("Unexpected tree in diff at path {path:?}");
|
panic!("Unexpected tree in diff at path {path:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let hash = hash[0..10].to_string();
|
hash.truncate(10);
|
||||||
Ok(GitDiffPart {
|
Ok(GitDiffPart {
|
||||||
mode,
|
mode,
|
||||||
hash,
|
hash,
|
||||||
|
|
Loading…
Reference in a new issue