@@ -269,6 +269,9 @@ internal override SuggestionPackage Predict(
269
269
}
270
270
}
271
271
272
+ string activeBranch = repoInfo . ActiveBranch ;
273
+ string defaultBranch = repoInfo . DefaultBranch ;
274
+
272
275
if ( originBranches is not null )
273
276
{
274
277
// The 'origin' remote exists, so do a smart check to find those local branches
@@ -281,7 +284,7 @@ internal override SuggestionPackage Predict(
281
284
foreach ( string branch in localBranches )
282
285
{
283
286
if ( branch . StartsWith ( filter , StringComparison . Ordinal ) &&
284
- branch != repoInfo . ActiveBranch )
287
+ branch != activeBranch )
285
288
{
286
289
ret ??= new List < string > ( ) ;
287
290
ret . Add ( branch ) ;
@@ -296,8 +299,8 @@ internal override SuggestionPackage Predict(
296
299
foreach ( string branch in repoInfo . Branches )
297
300
{
298
301
if ( branch . StartsWith ( filter , StringComparison . Ordinal ) &&
299
- branch != repoInfo . ActiveBranch &&
300
- branch != repoInfo . DefaultBranch )
302
+ branch != activeBranch &&
303
+ branch != defaultBranch )
301
304
{
302
305
ret ??= new List < string > ( ) ;
303
306
ret . Add ( branch ) ;
@@ -385,10 +388,11 @@ internal override SuggestionPackage Predict(
385
388
private List < string > ? PredictArgument ( string filter , RepoInfo repoInfo , bool excludeActiveBranch )
386
389
{
387
390
List < string > ? ret = null ;
391
+ string activeBranch = repoInfo . ActiveBranch ;
388
392
389
393
foreach ( string localBranch in repoInfo . Branches )
390
394
{
391
- if ( excludeActiveBranch && localBranch == repoInfo . ActiveBranch )
395
+ if ( excludeActiveBranch && localBranch == activeBranch )
392
396
{
393
397
continue ;
394
398
}
@@ -428,7 +432,7 @@ internal override SuggestionPackage Predict(
428
432
429
433
if ( textAtCursor is not null && textAtCursor . StartsWith ( '-' ) )
430
434
{
431
- const string forceWithLease = "--force-with-lease " ;
435
+ const string forceWithLease = "--force-with-lease" ;
432
436
if ( forceWithLease . StartsWith ( textAtCursor , StringComparison . Ordinal ) )
433
437
{
434
438
hasAutoFill = true ;
0 commit comments