Showing the changes to git-pack/src/data (4 of 100 files). Show all
Unified · Split
| @@ -23,8 +23,7 @@ impl data::File { · 22 unmodified lines | |||
| 23 | let pack_len = data.len(); | 23 | let pack_len = data.len(); |
| 24 | if pack_len < N32_SIZE * 3 + hash_len { | 24 | if pack_len < N32_SIZE * 3 + hash_len { |
| 25 | return Err(data::header::decode::Error::Corrupt(format!( | 25 | return Err(data::header::decode::Error::Corrupt(format!( |
| 26 | "Pack data of size {} is too small for even an empty pack with shortest hash", | 26 | "Pack data of size {pack_len} is too small for even an empty pack with shortest hash" |
| 27 | pack_len | ||
| 28 | ))); | 27 | ))); |
| 29 | } | 28 | } |
| 30 | let (kind, num_objects) = | 29 | let (kind, num_objects) = |
| @@ -90,11 +90,11 @@ where · 89 unmodified lines | |||
| 90 | } else { | 90 | } else { |
| 91 | header_bytes.len() as u64 | 91 | header_bytes.len() as u64 |
| 92 | }; | 92 | }; |
| 93 | self.output.seek(std::io::SeekFrom::Start(0))?; | 93 | self.output.rewind()?; |
| 94 | self.output.write_all(&header_bytes[..])?; | 94 | self.output.write_all(&header_bytes[..])?; |
| 95 | self.output.flush()?; | 95 | self.output.flush()?; |
| 96 | 96 | ||
| 97 | self.output.seek(std::io::SeekFrom::Start(0))?; | 97 | self.output.rewind()?; |
| 98 | let interrupt_never = std::sync::atomic::AtomicBool::new(false); | 98 | let interrupt_never = std::sync::atomic::AtomicBool::new(false); |
| 99 | let digest = hash::bytes( | 99 | let digest = hash::bytes( |
| 100 | &mut self.output, | 100 | &mut self.output, |
| @@ -79,7 +79,7 @@ where · 78 unmodified lines | |||
| 79 | { | 79 | { |
| 80 | let mut p = progress | 80 | let mut p = progress |
| 81 | .lock() | 81 | .lock() |
| 82 | .add_child_with_id(format!("thread {}", n), git_features::progress::UNKNOWN); | 82 | .add_child_with_id(format!("thread {n}"), git_features::progress::UNKNOWN); |
| 83 | p.init(None, git_features::progress::count("objects")); | 83 | p.init(None, git_features::progress::count("objects")); |
| 84 | p | 84 | p |
| 85 | }, | 85 | }, |
| @@ -143,7 +143,7 @@ pub(crate) mod function { · 142 unmodified lines | |||
| 143 | Vec::new(), // object data buffer | 143 | Vec::new(), // object data buffer |
| 144 | progress | 144 | progress |
| 145 | .lock() | 145 | .lock() |
| 146 | .add_child_with_id(format!("thread {}", n), git_features::progress::UNKNOWN), | 146 | .add_child_with_id(format!("thread {n}"), git_features::progress::UNKNOWN), |
| 147 | ) | 147 | ) |
| 148 | } | 148 | } |
| 149 | }, | 149 | }, |