History

Note about why git_features::hash::bytes_of_file() is not yet used

Sebastian Thiel committed 6 years ago

Commit ca48fc41 parent c0002941 file · +4 −1Browse files

Showing the changes to git-commitgraph/src (1 of 1 file). Show all

Unified · Split

git-commitgraph/src/file/verify.rs+4−1
@@ -118,7 +118,10 @@ impl File { · 117 unmodified lines
118 }118 }
119 119
120 pub fn verify_checksum(&self) -> Result<owned::Id, (owned::Id, owned::Id)> {120 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.
122 let data_len_without_trailer = self.data.len() - SHA1_SIZE;125 let data_len_without_trailer = self.data.len() - SHA1_SIZE;
123 let mut hasher = git_features::hash::Sha1::default();126 let mut hasher = git_features::hash::Sha1::default();
124 hasher.update(&self.data[..data_len_without_trailer]);127 hasher.update(&self.data[..data_len_without_trailer]);