@@ -262,7 +262,7 @@ mod write_object {
262
262
let oid = repo. write_object ( gix:: objs:: TreeRef :: empty ( ) ) ?;
263
263
assert_eq ! (
264
264
oid,
265
- gix :: hash :: ObjectId :: empty_tree ( repo. object_hash( ) ) ,
265
+ repo. object_hash( ) . empty_tree ( ) ,
266
266
"it produces a well-known empty tree id"
267
267
) ;
268
268
Ok ( ( ) )
@@ -277,7 +277,7 @@ mod write_object {
277
277
time : Default :: default ( ) ,
278
278
} ;
279
279
let commit = gix:: objs:: Commit {
280
- tree : gix :: hash :: ObjectId :: empty_tree ( repo. object_hash ( ) ) ,
280
+ tree : repo. object_hash ( ) . empty_tree ( ) ,
281
281
author : actor. clone ( ) ,
282
282
committer : actor,
283
283
parents : Default :: default ( ) ,
@@ -292,6 +292,21 @@ mod write_object {
292
292
) ;
293
293
Ok ( ( ) )
294
294
}
295
+
296
+ #[ test]
297
+ fn blob_write_to_implementation ( ) -> crate :: Result {
298
+ let repo = empty_bare_in_memory_repo ( ) ?;
299
+ let blob = repo. empty_blob ( ) ;
300
+
301
+ // Create a blob directly to test our WriteTo implementation
302
+ let actual_id = repo. write_object ( & blob) ?;
303
+ let actual_blob = repo. find_object ( actual_id) ?. into_blob ( ) ;
304
+ assert_eq ! ( actual_id, repo. object_hash( ) . empty_blob( ) ) ;
305
+
306
+ assert_eq ! ( actual_blob. data, blob. data) ;
307
+
308
+ Ok ( ( ) )
309
+ }
295
310
}
296
311
297
312
mod write_blob {
0 commit comments