File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -231,13 +231,45 @@ public WorkingCopy(Repository repo)
231231
232232 public void SetData ( List < Models . Change > changes )
233233 {
234- if ( ! IsChanged ( _cached , changes ) )
234+ do
235235 {
236+ if ( IsChanged ( _cached , changes ) )
237+ break ;
238+
239+ if ( _useAmend )
240+ {
241+ var testStaged = GetStagedChanges ( _cached ) ;
242+ if ( IsChanged ( _staged , testStaged ) )
243+ {
244+ var visibleStagedNew = GetVisibleChanges ( testStaged ) ;
245+ var selectedStagedNew = new List < Models . Change > ( ) ;
246+
247+ if ( _selectedStaged is { Count : > 0 } )
248+ {
249+ var set = new HashSet < string > ( ) ;
250+ foreach ( var c in _selectedStaged )
251+ set . Add ( c . Path ) ;
252+
253+ foreach ( var c in visibleStagedNew )
254+ {
255+ if ( set . Contains ( c . Path ) )
256+ selectedStagedNew . Add ( c ) ;
257+ }
258+ }
259+
260+ _isLoadingData = true ;
261+ Staged = testStaged ;
262+ VisibleStaged = visibleStagedNew ;
263+ SelectedStaged = selectedStagedNew ;
264+ _isLoadingData = false ;
265+ }
266+ }
267+
236268 HasUnsolvedConflicts = _cached . Find ( x => x . IsConflicted ) != null ;
237269 UpdateInProgressState ( ) ;
238270 UpdateDetail ( ) ;
239271 return ;
240- }
272+ } while ( false ) ;
241273
242274 var lastSelectedUnstaged = new HashSet < string > ( ) ;
243275 if ( _selectedUnstaged is { Count : > 0 } )
You can’t perform that action at this time.
0 commit comments