File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ impl From<Oid> for CommitId {
8484 }
8585}
8686
87+ impl From < gix:: ObjectId > for CommitId {
88+ fn from ( object_id : gix:: ObjectId ) -> Self {
89+ #[ allow( clippy:: expect_used) ]
90+ let oid = Oid :: from_bytes ( object_id. as_bytes ( ) ) . expect ( "`Oid::from_bytes(object_id.as_bytes())` is expected to never fail" ) ;
91+
92+ Self :: new ( oid)
93+ }
94+ }
95+
8796///
8897#[ derive( Debug , Clone ) ]
8998pub struct CommitInfo {
Original file line number Diff line number Diff line change @@ -161,10 +161,7 @@ impl<'a> LogWalkerWithoutFilter<'a> {
161161 let mut count = 0_usize ;
162162
163163 while let Some ( Ok ( info) ) = self . walk . next ( ) {
164- let bytes = info. id . as_bytes ( ) ;
165- let commit_id: CommitId = Oid :: from_bytes ( bytes) ?. into ( ) ;
166-
167- out. push ( commit_id) ;
164+ out. push ( info. id . into ( ) ) ;
168165
169166 count += 1 ;
170167
You can’t perform that action at this time.
0 commit comments