File tree 5 files changed +7
-6
lines changed
5 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,11 @@ fn leb64decode(d: &[u8]) -> (u64, usize) {
76
76
fn streaming_leb64decode ( mut r : impl io:: Read ) -> Result < ( u64 , usize ) , io:: Error > {
77
77
let mut b = [ 0u8 ; 1 ] ;
78
78
let mut i = 0 ;
79
- r. read ( & mut b) ?;
79
+ r. read_exact ( & mut b) ?;
80
80
i += 1 ;
81
81
let mut value = b[ 0 ] as u64 & 0x7f ;
82
82
while b[ 0 ] & 0x80 != 0 {
83
- r. read ( & mut b) ?;
83
+ r. read_exact ( & mut b) ?;
84
84
i += 1 ;
85
85
value += 1 ;
86
86
value = ( value << 7 ) + ( b[ 0 ] as u64 & 0x7f )
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ impl index::File {
21
21
let r =
22
22
io:: BufReader :: new ( fs:: File :: open ( pack. path ( ) ) . map_err ( |err| Error :: Io ( err, pack. path ( ) . into ( ) , "open" ) ) ?) ;
23
23
pack:: graph:: DeltaTree :: from_sorted_offsets ( self . sorted_offsets ( ) . into_iter ( ) , r, indexing_progress) ?;
24
+
24
25
unimplemented ! ( )
25
26
}
26
27
}
Original file line number Diff line number Diff line change @@ -163,15 +163,15 @@ where
163
163
let idx = git_odb:: pack:: index:: File :: at ( path) . with_context ( || "Could not open pack index file" ) ?;
164
164
let packfile_path = path. with_extension ( "pack" ) ;
165
165
let pack = git_odb:: pack:: data:: File :: at ( & packfile_path)
166
- . or_else ( |e| {
166
+ . map_err ( |e| {
167
167
writeln ! (
168
168
err,
169
169
"Could not find matching pack file at '{}' - only index file will be verified, error was: {}" ,
170
170
packfile_path. display( ) ,
171
171
e
172
172
)
173
173
. ok ( ) ;
174
- Err ( e )
174
+ e
175
175
} )
176
176
. ok ( ) ;
177
177
let cache = || -> EitherCache {
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ pub fn main() -> Result<()> {
118
118
} else {
119
119
None
120
120
} ,
121
- algorithm : algorithm. unwrap_or ( core:: VerifyAlgorithm :: Lookup ) . into ( ) ,
121
+ algorithm : algorithm. unwrap_or ( core:: VerifyAlgorithm :: Lookup ) ,
122
122
thread_limit,
123
123
mode : match ( decode, re_encode) {
124
124
( true , false ) => core:: VerifyMode :: Sha1CRC32Decode ,
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ pub fn main() -> Result<()> {
208
208
core:: Context {
209
209
output_statistics,
210
210
thread_limit,
211
- algorithm : algorithm . into ( ) ,
211
+ algorithm,
212
212
mode,
213
213
out,
214
214
err,
You can’t perform that action at this time.
0 commit comments