From fb910675f3dfb9c2c543c13db26bddd427821814 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Mon, 25 Mar 2019 19:00:41 -0600 Subject: [PATCH] Fix #670 BranchBehindAndAheadDisplay minimal/compact bug --- src/GitPrompt.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/GitPrompt.ps1 b/src/GitPrompt.ps1 index 37996edb1..16cffc1a4 100644 --- a/src/GitPrompt.ps1 +++ b/src/GitPrompt.ps1 @@ -451,18 +451,27 @@ function Write-GitBranchStatus { elseif ($s.BranchBehindAndAheadDisplay -eq "Compact") { $branchStatusTextSpan.Text = ("{0}{1}{2}" -f $Status.BehindBy, $s.BranchBehindAndAheadStatusSymbol.Text, $Status.AheadBy) } + else { + $branchStatusTextSpan.Text = $s.BranchBehindAndAheadStatusSymbol.Text + } } elseif ($Status.BehindBy -ge 1) { # We are behind remote if (($s.BranchBehindAndAheadDisplay -eq "Full") -Or ($s.BranchBehindAndAheadDisplay -eq "Compact")) { $branchStatusTextSpan.Text = ("{0}{1}" -f $s.BranchBehindStatusSymbol.Text, $Status.BehindBy) } + else { + $branchStatusTextSpan.Text = $s.BranchBehindStatusSymbol.Text + } } elseif ($Status.AheadBy -ge 1) { # We are ahead of remote if (($s.BranchBehindAndAheadDisplay -eq "Full") -or ($s.BranchBehindAndAheadDisplay -eq "Compact")) { $branchStatusTextSpan.Text = ("{0}{1}" -f $s.BranchAheadStatusSymbol.Text, $Status.AheadBy) } + else { + $branchStatusTextSpan.Text = $s.BranchAheadStatusSymbol.Text + } } else { # This condition should not be possible but defaulting the variables to be safe