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 {
78
78
}
79
79
}
80
80
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
+
81
92
impl From < ObjectRef < ' _ > > for Object {
82
93
fn from ( v : ObjectRef < ' _ > ) -> Self {
83
94
match v {
Original file line number Diff line number Diff line change @@ -619,6 +619,7 @@ fn from_existing_add() -> crate::Result {
619
619
let root_tree = find_tree ( & odb, root_tree_id) ?;
620
620
odb. access_count_and_clear ( ) ;
621
621
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" ) ;
622
623
623
624
let actual = edit. write ( & mut write) . expect ( "no changes are fine" ) ;
624
625
assert_eq ! ( actual, root_tree_id, "it rewrites the same tree" ) ;
You can’t perform that action at this time.
0 commit comments