File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -160,13 +160,18 @@ impl crate::Repository {
160
160
) -> Result < Id < ' _ > , object:: write:: Error > {
161
161
let mut buf = self . shared_empty_buf ( ) ;
162
162
std:: io:: copy ( & mut bytes, buf. deref_mut ( ) ) . expect ( "write to memory works" ) ;
163
- let oid = gix_object:: compute_hash ( self . object_hash ( ) , gix_object:: Kind :: Blob , & buf) ;
163
+
164
+ self . write_blob_stream_inner ( & buf)
165
+ }
166
+
167
+ fn write_blob_stream_inner ( & self , buf : & [ u8 ] ) -> Result < Id < ' _ > , object:: write:: Error > {
168
+ let oid = gix_object:: compute_hash ( self . object_hash ( ) , gix_object:: Kind :: Blob , buf) ;
164
169
if self . objects . contains ( & oid) {
165
170
return Ok ( oid. attach ( self ) ) ;
166
171
}
167
172
168
173
self . objects
169
- . write_buf ( gix_object:: Kind :: Blob , & buf)
174
+ . write_buf ( gix_object:: Kind :: Blob , buf)
170
175
. map_err ( Into :: into)
171
176
. map ( |oid| oid. attach ( self ) )
172
177
}
You can’t perform that action at this time.
0 commit comments