Skip to content

Commit

Permalink
Merge branch 'master' into useGitStatusCache
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarcusreid committed Sep 25, 2015
2 parents 008836e + fadc4dd commit 49bb147
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ function Get-GitStatus($gitDir = (Get-GitDirectory)) {
} else {
dbg 'Getting status' $sw
$status = git -c color.status=false status --short --branch 2>$null
$stashCount = $null | git stash list 2>$null | measure-object | select -expand Count
if($settings.EnableStashStatus) {
dbg 'Getting stash count' $sw
$stashCount = $null | git stash list 2>$null | measure-object | select -expand Count
}

dbg 'Parsing status' $sw
$status | foreach {
Expand Down Expand Up @@ -276,7 +279,7 @@ function Set-TempEnv($key, $value) {
# is a running agent.
function Get-SshAgent() {
if ($env:GIT_SSH -imatch 'plink') {
$pageantPid = Get-Process | Where-Object { $_.Name -eq 'pageant' } | Select -ExpandProperty Id
$pageantPid = Get-Process | Where-Object { $_.Name -eq 'pageant' } | Select -ExpandProperty Id -First 1
if ($null -ne $pageantPid) { return $pageantPid }
} else {
$agentPid = $Env:SSH_AGENT_PID
Expand Down Expand Up @@ -335,7 +338,7 @@ function Start-SshAgent([switch]$Quiet) {
$pageant = Get-Command pageant -TotalCount 1 -Erroraction SilentlyContinue
$pageant = if ($pageant) {$pageant} else {Guess-Pageant}
if (!$pageant) { Write-Warning "Could not find Pageant."; return }
& $pageant
Start-Process -NoNewWindow $pageant
} else {
$sshAgent = Get-Command ssh-agent -TotalCount 1 -ErrorAction SilentlyContinue
$sshAgent = if ($sshAgent) {$sshAgent} else {Guess-Ssh('ssh-agent')}
Expand Down

0 comments on commit 49bb147

Please sign in to comment.