File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,9 @@ public async Task<bool> CheckoutBranchByDecoratorAsync(Models.Decorator decorato
242
242
243
243
public async Task CheckoutBranchByCommitAsync ( Models . Commit commit )
244
244
{
245
+ if ( commit == null )
246
+ return ;
247
+
245
248
if ( commit . IsCurrentHead )
246
249
return ;
247
250
@@ -265,7 +268,7 @@ public async Task CheckoutBranchByCommitAsync(Models.Commit commit)
265
268
continue ;
266
269
267
270
var lb = _repo . Branches . Find ( x => x . IsLocal && x . Upstream == rb . FullName ) ;
268
- if ( lb is { TrackStatus . Ahead . Count : 0 } )
271
+ if ( lb != null && lb . TrackStatus != null && lb . TrackStatus . Behind . Count > 0 && lb . TrackStatus . Ahead . Count == 0 )
269
272
{
270
273
if ( _repo . CanCreatePopup ( ) )
271
274
_repo . ShowPopup ( new CheckoutAndFastForward ( _repo , lb , rb ) ) ;
You can’t perform that action at this time.
0 commit comments