@@ -269,6 +269,9 @@ internal override SuggestionPackage Predict(
269269 }
270270 }
271271
272+ string activeBranch = repoInfo . ActiveBranch ;
273+ string defaultBranch = repoInfo . DefaultBranch ;
274+
272275 if ( originBranches is not null )
273276 {
274277 // The 'origin' remote exists, so do a smart check to find those local branches
@@ -281,7 +284,7 @@ internal override SuggestionPackage Predict(
281284 foreach ( string branch in localBranches )
282285 {
283286 if ( branch . StartsWith ( filter , StringComparison . Ordinal ) &&
284- branch != repoInfo . ActiveBranch )
287+ branch != activeBranch )
285288 {
286289 ret ??= new List < string > ( ) ;
287290 ret . Add ( branch ) ;
@@ -296,8 +299,8 @@ internal override SuggestionPackage Predict(
296299 foreach ( string branch in repoInfo . Branches )
297300 {
298301 if ( branch . StartsWith ( filter , StringComparison . Ordinal ) &&
299- branch != repoInfo . ActiveBranch &&
300- branch != repoInfo . DefaultBranch )
302+ branch != activeBranch &&
303+ branch != defaultBranch )
301304 {
302305 ret ??= new List < string > ( ) ;
303306 ret . Add ( branch ) ;
@@ -385,10 +388,11 @@ internal override SuggestionPackage Predict(
385388 private List < string > ? PredictArgument ( string filter , RepoInfo repoInfo , bool excludeActiveBranch )
386389 {
387390 List < string > ? ret = null ;
391+ string activeBranch = repoInfo . ActiveBranch ;
388392
389393 foreach ( string localBranch in repoInfo . Branches )
390394 {
391- if ( excludeActiveBranch && localBranch == repoInfo . ActiveBranch )
395+ if ( excludeActiveBranch && localBranch == activeBranch )
392396 {
393397 continue ;
394398 }
@@ -428,7 +432,7 @@ internal override SuggestionPackage Predict(
428432
429433 if ( textAtCursor is not null && textAtCursor . StartsWith ( '-' ) )
430434 {
431- const string forceWithLease = "--force-with-lease " ;
435+ const string forceWithLease = "--force-with-lease" ;
432436 if ( forceWithLease . StartsWith ( textAtCursor , StringComparison . Ordinal ) )
433437 {
434438 hasAutoFill = true ;
0 commit comments