@@ -121,7 +121,7 @@ impl<'repo> delegate::Navigate for Delegate<'repo> {
121
121
let lookup_path = |obj : & ObjectId | {
122
122
let tree_id = peel ( repo, obj, gix_object:: Kind :: Tree ) ?;
123
123
if path. is_empty ( ) {
124
- return Ok ( tree_id) ;
124
+ return Ok ( ( tree_id, gix_object :: tree :: EntryKind :: Tree . into ( ) ) ) ;
125
125
}
126
126
let mut tree = repo. find_object ( tree_id) ?. into_tree ( ) ;
127
127
let entry =
@@ -131,11 +131,17 @@ impl<'repo> delegate::Navigate for Delegate<'repo> {
131
131
object : obj. attach ( repo) . shorten_or_id ( ) ,
132
132
tree : tree_id. attach ( repo) . shorten_or_id ( ) ,
133
133
} ) ?;
134
- Ok ( entry. object_id ( ) )
134
+ Ok ( ( entry. object_id ( ) , entry . mode ( ) ) )
135
135
} ;
136
136
for obj in objs. iter ( ) {
137
137
match lookup_path ( obj) {
138
- Ok ( replace) => replacements. push ( ( * obj, replace) ) ,
138
+ Ok ( ( replace, mode) ) => {
139
+ if !path. is_empty ( ) {
140
+ // Technically this is letting the last one win, but so be it.
141
+ self . paths [ self . idx ] = Some ( ( path. to_owned ( ) , mode) ) ;
142
+ }
143
+ replacements. push ( ( * obj, replace) )
144
+ }
139
145
Err ( err) => errors. push ( ( * obj, err) ) ,
140
146
}
141
147
}
@@ -306,6 +312,14 @@ impl<'repo> delegate::Navigate for Delegate<'repo> {
306
312
self . objs [ self . idx ]
307
313
. get_or_insert_with ( HashSet :: default)
308
314
. insert ( entry. id ) ;
315
+
316
+ self . paths [ self . idx ] = Some ( (
317
+ path. to_owned ( ) ,
318
+ entry
319
+ . mode
320
+ . to_tree_entry_mode ( )
321
+ . unwrap_or ( gix_object:: tree:: EntryKind :: Blob . into ( ) ) ,
322
+ ) ) ;
309
323
Some ( ( ) )
310
324
}
311
325
None => {
0 commit comments