@@ -51,6 +51,7 @@ struct Transaction2 {
5151 commit_map : HashMap < git2:: Oid , HashMap < git2:: Oid , git2:: Oid > > ,
5252 apply_map : HashMap < git2:: Oid , HashMap < git2:: Oid , git2:: Oid > > ,
5353 unapply_map : HashMap < git2:: Oid , HashMap < git2:: Oid , git2:: Oid > > ,
54+ dir_map : HashMap < ( git2:: Oid , String ) , git2:: Oid > ,
5455 sled_trees : HashMap < git2:: Oid , sled:: Tree > ,
5556 missing : Vec < ( filter:: Filter , git2:: Oid ) > ,
5657 misses : usize ,
@@ -84,6 +85,7 @@ impl Transaction {
8485 commit_map : HashMap :: new ( ) ,
8586 apply_map : HashMap :: new ( ) ,
8687 unapply_map : HashMap :: new ( ) ,
88+ dir_map : HashMap :: new ( ) ,
8789 sled_trees : HashMap :: new ( ) ,
8890 missing : vec ! [ ] ,
8991 misses : 0 ,
@@ -153,6 +155,11 @@ impl Transaction {
153155 . insert ( from, to) ;
154156 }
155157
158+ pub fn insert_dir ( & self , tree : ( git2:: Oid , String ) , result : git2:: Oid ) {
159+ let mut t2 = self . t2 . borrow_mut ( ) ;
160+ t2. dir_map . entry ( tree) . or_insert ( result) ;
161+ }
162+
156163 pub fn insert_ref (
157164 & self ,
158165 filter : filter:: Filter ,
@@ -194,6 +201,11 @@ impl Transaction {
194201 return None ;
195202 }
196203
204+ pub fn get_dir ( & self , tree : ( git2:: Oid , String ) ) -> Option < git2:: Oid > {
205+ let t2 = self . t2 . borrow_mut ( ) ;
206+ return t2. dir_map . get ( & tree) . cloned ( ) ;
207+ }
208+
197209 pub fn insert (
198210 & self ,
199211 filter : filter:: Filter ,
0 commit comments