Permalink
Browse files

Added the ability to disable file status on a repo-by-repo basis by a…

…dding repo paths to $global:GitPromptSettings.RepositoriesInWhichToDisableFileStatus.
  • Loading branch information...
1 parent 841af46 commit 7a453d8934db57472f7007d3c5de496752ea36fc @SaintGimp SaintGimp committed with Oct 8, 2011
Showing with 15 additions and 1 deletion.
  1. +1 −0 GitPrompt.ps1
  2. +14 −1 GitUtils.ps1
View
@@ -42,6 +42,7 @@ $global:GitPromptSettings = New-Object PSObject -Property @{
EnablePromptStatus = !$GitMissing
EnableFileStatus = $true
+ RepositoriesInWhichToDisableFileStatus = @( ) # Array of repository paths
Debug = $false
}
View
@@ -86,7 +86,7 @@ function Get-GitStatus($gitDir = (Get-GitDirectory)) {
$filesDeleted = @()
$filesUnmerged = @()
- if($settings.EnableFileStatus) {
+ if($settings.EnableFileStatus -and !$(InDisabledRepository)) {
dbg 'Getting status' $sw
$status = git status --short --branch 2>$null
} else {
@@ -163,6 +163,19 @@ function Get-GitStatus($gitDir = (Get-GitDirectory)) {
}
}
+function InDisabledRepository {
+ $currentLocation = Get-Location
+
+ foreach ($repo in $Global:GitPromptSettings.RepositoriesInWhichToDisableFileStatus)
+ {
+ if ($currentLocation -like "$repo*") {
+ return $true
+ }
+ }
+
+ return $false
+}
+
function Enable-GitColors {
$env:TERM = 'cygwin'
}

0 comments on commit 7a453d8

Please sign in to comment.