@@ -75,7 +75,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
75
75
let mut ignored_changes = Vec :: new ( ) ;
76
76
for change in status_changes {
77
77
let change = change?;
78
- let change = match change {
78
+ let change = match change. clone ( ) {
79
79
status:: Item :: TreeIndex ( gix:: diff:: index:: Change :: Deletion {
80
80
location,
81
81
id,
@@ -91,6 +91,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
91
91
} ,
92
92
} ,
93
93
path : location. into_owned ( ) ,
94
+ status_item : Some ( change) ,
94
95
} ,
95
96
) ,
96
97
status:: Item :: TreeIndex ( gix:: diff:: index:: Change :: Addition {
@@ -109,6 +110,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
109
110
kind : into_tree_entry_kind ( entry_mode) ?,
110
111
} ,
111
112
} ,
113
+ status_item : Some ( change) ,
112
114
} ,
113
115
) ,
114
116
status:: Item :: TreeIndex ( gix:: diff:: index:: Change :: Modification {
@@ -136,6 +138,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
136
138
state,
137
139
flags : ModeFlags :: calculate ( & previous_state, & state) ,
138
140
} ,
141
+ status_item : Some ( change) ,
139
142
} ,
140
143
)
141
144
}
@@ -154,6 +157,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
154
157
kind : into_tree_entry_kind ( entry. mode ) ?,
155
158
} ,
156
159
} ,
160
+ status_item : Some ( change) ,
157
161
} ,
158
162
) ,
159
163
status:: Item :: IndexWorktree ( index_worktree:: Item :: Modification {
@@ -180,6 +184,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
180
184
state,
181
185
flags : ModeFlags :: calculate ( & previous_state, & state) ,
182
186
} ,
187
+ status_item : Some ( change) ,
183
188
} ,
184
189
)
185
190
}
@@ -216,6 +221,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
216
221
state,
217
222
flags : ModeFlags :: calculate ( & previous_state, & state) ,
218
223
} ,
224
+ status_item : Some ( change) ,
219
225
} ,
220
226
)
221
227
}
@@ -237,6 +243,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
237
243
} ,
238
244
is_untracked : false ,
239
245
} ,
246
+ status_item : Some ( change) ,
240
247
} ,
241
248
) ,
242
249
status:: Item :: IndexWorktree ( index_worktree:: Item :: DirectoryContents {
@@ -269,17 +276,20 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
269
276
} ,
270
277
is_untracked : true ,
271
278
} ,
279
+ status_item : Some ( change) ,
272
280
} ,
273
281
)
274
282
}
275
283
status:: Item :: IndexWorktree ( index_worktree:: Item :: Modification {
276
284
rela_path,
277
285
entry,
278
286
status :
279
- EntryStatus :: Change ( index_as_worktree:: Change :: SubmoduleModification ( change) ) ,
287
+ EntryStatus :: Change ( index_as_worktree:: Change :: SubmoduleModification (
288
+ submodule_change,
289
+ ) ) ,
280
290
..
281
291
} ) => {
282
- let Some ( checked_out_head_id) = change . checked_out_head_id else {
292
+ let Some ( checked_out_head_id) = submodule_change . checked_out_head_id else {
283
293
continue ;
284
294
} ;
285
295
// We can arrive here if the user configures to `ignore = none`, and there are
@@ -306,6 +316,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
306
316
state,
307
317
flags : ModeFlags :: calculate ( & previous_state, & state) ,
308
318
} ,
319
+ status_item : Some ( change) ,
309
320
} ,
310
321
)
311
322
}
@@ -361,6 +372,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
361
372
state,
362
373
flags : ModeFlags :: calculate ( & previous_state, & state) ,
363
374
} ,
375
+ status_item : Some ( change) ,
364
376
} ,
365
377
)
366
378
}
@@ -391,6 +403,7 @@ pub fn worktree_changes(repo: &gix::Repository) -> anyhow::Result<WorktreeChange
391
403
state,
392
404
flags : ModeFlags :: calculate ( & previous_state, & state) ,
393
405
} ,
406
+ status_item : Some ( change) ,
394
407
} ,
395
408
)
396
409
}
@@ -655,6 +668,8 @@ fn merge_changes(
655
668
status : TreeStatus :: Deletion {
656
669
previous_state : * previous_state,
657
670
} ,
671
+ // NOTE: not relevant, as renames are disabled for snapshots where this is used.
672
+ status_item : None ,
658
673
} ) ) ;
659
674
}
660
675
(
@@ -674,6 +689,8 @@ fn merge_changes(
674
689
// It's just in the index, which to us doesn't exist.
675
690
is_untracked : true ,
676
691
} ,
692
+ // NOTE: not relevant, as renames are disabled for snapshots where this is used.
693
+ status_item : None ,
677
694
} ) ,
678
695
Some ( TreeChange {
679
696
path : index_wt. path ,
@@ -685,6 +702,8 @@ fn merge_changes(
685
702
// read the initial state of a file from.
686
703
is_untracked : true ,
687
704
} ,
705
+ // NOTE: not relevant, as renames are disabled for snapshots where this is used.
706
+ status_item : None ,
688
707
} ) ,
689
708
] ) ;
690
709
}
0 commit comments