Browse files

Move affect of $GitPromptSettings.EnablePromptStatus up into Get-GitS…

…tatus
  • Loading branch information...
1 parent 2434f2e commit ecce85717ae6dd1f9fa9958673b34e9ebfbbdec6 @dahlbyk committed Sep 16, 2010
Showing with 5 additions and 5 deletions.
  1. +3 −1 GitUtils.ps1
  2. +2 −4 profile.example.ps1
View
4 GitUtils.ps1
@@ -58,7 +58,9 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory)) {
}
function Get-GitStatus($gitDir = (Get-GitDirectory)) {
- if ($gitDir)
+ $settings = $Global:GitPromptSettings
+ $enabled = (-not $settings) -or $settings.EnablePromptStatus
+ if ($enabled -and $gitDir)
{
$branch = ''
$aheadBy = 0
View
6 profile.example.ps1
@@ -13,10 +13,8 @@ function prompt {
Write-Host($pwd) -nonewline
# Git Prompt
- if($Global:GitPromptSettings.EnablePromptStatus) {
- $Global:GitStatus = Get-GitStatus
- Write-GitStatus $GitStatus
- }
+ $Global:GitStatus = Get-GitStatus
+ Write-GitStatus $GitStatus
return "> "
}

0 comments on commit ecce857

Please sign in to comment.