File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,17 @@ impl From<tree::EntryRef<'_>> for tree::Entry {
7878 }
7979}
8080
81+ impl < ' a > From < & ' a tree:: Entry > for tree:: EntryRef < ' a > {
82+ fn from ( other : & ' a tree:: Entry ) -> tree:: EntryRef < ' a > {
83+ let tree:: Entry { mode, filename, oid } = other;
84+ tree:: EntryRef {
85+ mode : * mode,
86+ filename : filename. as_ref ( ) ,
87+ oid : & oid,
88+ }
89+ }
90+ }
91+
8192impl From < ObjectRef < ' _ > > for Object {
8293 fn from ( v : ObjectRef < ' _ > ) -> Self {
8394 match v {
Original file line number Diff line number Diff line change @@ -619,6 +619,7 @@ fn from_existing_add() -> crate::Result {
619619 let root_tree = find_tree ( & odb, root_tree_id) ?;
620620 odb. access_count_and_clear ( ) ;
621621 let mut edit = gix_object:: tree:: Editor :: new ( root_tree. clone ( ) , & odb, gix_hash:: Kind :: Sha1 ) ;
622+ assert ! ( edit. get( & [ "bin" ] ) . is_some( ) , "the root is immediately available" ) ;
622623
623624 let actual = edit. write ( & mut write) . expect ( "no changes are fine" ) ;
624625 assert_eq ! ( actual, root_tree_id, "it rewrites the same tree" ) ;
You can’t perform that action at this time.
0 commit comments