@@ -1332,12 +1332,23 @@ public void RefreshWorkingCopyChanges()
13321332 changes . Sort ( ( l , r ) => Models . NumericSort . Compare ( l . Path , r . Path ) ) ;
13331333 _workingCopy . SetData ( changes , token ) ;
13341334
1335+ var hasModified = false ;
1336+ foreach ( var c in changes )
1337+ {
1338+ if ( c . Index == Models . ChangeState . Added || c . WorkTree == Models . ChangeState . Untracked )
1339+ continue ;
1340+
1341+ hasModified = true ;
1342+ break ;
1343+ }
1344+
13351345 Dispatcher . UIThread . Invoke ( ( ) =>
13361346 {
13371347 if ( token . IsCancellationRequested )
13381348 return ;
13391349
13401350 LocalChangesCount = changes . Count ;
1351+ _canCheckoutDirectly = ! hasModified ;
13411352 OnPropertyChanged ( nameof ( InProgressContext ) ) ;
13421353 GetOwnerPage ( ) ? . ChangeDirtyState ( Models . DirtyState . HasLocalChanges , changes . Count == 0 ) ;
13431354 } ) ;
@@ -1411,7 +1422,10 @@ public async Task CheckoutBranchAsync(Models.Branch branch)
14111422
14121423 if ( branch . IsLocal )
14131424 {
1414- await ShowAndStartPopupAsync ( new Checkout ( this , branch ) ) ;
1425+ if ( _canCheckoutDirectly )
1426+ await ShowAndStartPopupAsync ( new Checkout ( this , branch ) ) ;
1427+ else
1428+ ShowPopup ( new Checkout ( this , branch ) ) ;
14151429 }
14161430 else
14171431 {
@@ -1965,6 +1979,7 @@ private async Task AutoFetchOnUIThread()
19651979 private List < Models . Submodule > _submodules = [ ] ;
19661980 private object _visibleSubmodules = null ;
19671981 private string _navigateToCommitDelayed = string . Empty ;
1982+ private bool _canCheckoutDirectly = false ;
19681983
19691984 private bool _isAutoFetching = false ;
19701985 private Timer _autoFetchTimer = null ;
0 commit comments