Permalink
Browse files

Added setting to control whether or not the indexis refreshed.

Rearranged arguments because they seem to be order-sensitive!!
  • Loading branch information...
1 parent 3e3b8bc commit 89c5de3af3ed561178f35e980d76ff104886ea98 @markembling markembling committed Apr 23, 2010
Showing with 6 additions and 1 deletion.
  1. +2 −0 GitPrompt.ps1
  2. +4 −1 GitUtils.ps1
View
2 GitPrompt.ps1
@@ -27,6 +27,8 @@ $global:GitPromptSettings = New-Object PSObject -Property @{
UntrackedBackgroundColor = $Host.UI.RawUI.BackgroundColor
ShowStatusWhenZero = $true
+
+ AutoRefreshIndex = $true
}
function Write-GitStatus($status) {
View
5 GitUtils.ps1
@@ -68,7 +68,10 @@ function Get-GitStatus {
$filesDeleted = @()
$filesUnmerged = @()
- git update-index --refresh -q
+ if ($global:GitPromptSettings.AutoRefreshIndex) {
+ git update-index -q --refresh
+ }
+
$aheadCount = (git cherry 2>$null | where { $_ -like '+*' } | Measure-Object).Count
$diffIndex = git diff-index -M --name-status --cached HEAD |

0 comments on commit 89c5de3

Please sign in to comment.