@@ -59,24 +59,16 @@ public Models.Stash SelectedStash
5959 Task . Run ( ( ) =>
6060 {
6161 var changes = new Commands . CompareRevisions ( _repo . FullPath , $ "{ value . SHA } ^", value . SHA ) . Result ( ) ;
62- var untracked = new HashSet < string > ( ) ;
63- if ( value . HasUntracked )
62+ if ( value . Parents . Count == 3 )
6463 {
65- var untrackedChanges = new Commands . CompareRevisions ( _repo . FullPath , "4b825dc642cb6eb9a060e54bf8d69288fbee4904" , value . Parents [ 2 ] ) . Result ( ) ;
66- foreach ( var c in untrackedChanges )
67- {
68- untracked . Add ( c . Path ) ;
64+ var untracked = new Commands . CompareRevisions ( _repo . FullPath , "4b825dc642cb6eb9a060e54bf8d69288fbee4904" , value . Parents [ 2 ] ) . Result ( ) ;
65+ foreach ( var c in untracked )
6966 changes . Add ( c ) ;
70- }
71- }
7267
73- changes . Sort ( ( l , r ) => Models . NumericSort . Compare ( l . Path , r . Path ) ) ;
68+ changes . Sort ( ( l , r ) => string . Compare ( l . Path , r . Path , StringComparison . Ordinal ) ) ;
69+ }
7470
75- Dispatcher . UIThread . Invoke ( ( ) =>
76- {
77- Changes = changes ;
78- _untrackedChanges = untracked ;
79- } ) ;
71+ Dispatcher . UIThread . Invoke ( ( ) => Changes = changes ) ;
8072 } ) ;
8173 }
8274 }
@@ -102,7 +94,7 @@ public Models.Change SelectedChange
10294 {
10395 if ( value == null )
10496 DiffContext = null ;
105- else if ( _untrackedChanges . Contains ( value . Path ) )
97+ else if ( value . Index == Models . ChangeState . Added && _selectedStash . Parents . Count == 3 )
10698 DiffContext = new DiffContext ( _repo . FullPath , new Models . DiffOption ( "4b825dc642cb6eb9a060e54bf8d69288fbee4904" , _selectedStash . Parents [ 2 ] , value ) , _diffContext ) ;
10799 else
108100 DiffContext = new DiffContext ( _repo . FullPath , new Models . DiffOption ( _selectedStash . Parents [ 0 ] , _selectedStash . SHA , value ) , _diffContext ) ;
@@ -178,7 +170,7 @@ public ContextMenu MakeContextMenu(Models.Stash stash)
178170 var opts = new List < Models . DiffOption > ( ) ;
179171 foreach ( var c in _changes )
180172 {
181- if ( _untrackedChanges . Contains ( c . Path ) )
173+ if ( c . Index == Models . ChangeState . Added && _selectedStash . Parents . Count == 3 )
182174 opts . Add ( new Models . DiffOption ( "4b825dc642cb6eb9a060e54bf8d69288fbee4904" , _selectedStash . Parents [ 2 ] , c ) ) ;
183175 else
184176 opts . Add ( new Models . DiffOption ( _selectedStash . Parents [ 0 ] , _selectedStash . SHA , c ) ) ;
@@ -303,7 +295,6 @@ private void RefreshVisible()
303295 private List < Models . Stash > _visibleStashes = new List < Models . Stash > ( ) ;
304296 private string _searchFilter = string . Empty ;
305297 private Models . Stash _selectedStash = null ;
306- private HashSet < string > _untrackedChanges = new HashSet < string > ( ) ;
307298 private List < Models . Change > _changes = null ;
308299 private Models . Change _selectedChange = null ;
309300 private DiffContext _diffContext = null ;
0 commit comments