Skip to content

Commit ca48fc4

Browse files
committed
Note about why git_features::hash::bytes_of_file() is not yet used
1 parent c000294 commit ca48fc4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git-commitgraph/src/file/verify.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ impl File {
118118
}
119119

120120
pub fn verify_checksum(&self) -> Result<owned::Id, (owned::Id, owned::Id)> {
121-
// TODO: Use/copy git_odb::hash::bytes_of_file.
121+
// Even though we could use git_features::hash::bytes_of_file(…), this would require using our own
122+
// Error type to support io::Error and Mismatch. As we only gain progress, there probably isn't much value
123+
// as these files are usually small enough to process them in less than a second, even for the large ones.
124+
// But it's possible, once a progress instance is passed.
122125
let data_len_without_trailer = self.data.len() - SHA1_SIZE;
123126
let mut hasher = git_features::hash::Sha1::default();
124127
hasher.update(&self.data[..data_len_without_trailer]);

0 commit comments

Comments
 (0)