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 Jan 10, 2016
2 parents 49bb147 + 7210894 commit 0febf54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function Set-TempEnv($key, $value) {
}
} else {
New-Item $path -Force -ItemType File > $null
$value > $path
$value | Out-File -FilePath $path -Encoding ascii -Force
}
}

Expand All @@ -298,7 +298,7 @@ function Get-SshAgent() {
}

# Attempt to guess Pageant's location
function Guess-Pageant() {
function Find-Pageant() {
Write-Verbose "Pageant not in path. Trying to guess location."
$gitSsh = $env:GIT_SSH
if ($gitSsh -and (test-path $gitSsh)) {
Expand All @@ -309,7 +309,7 @@ function Guess-Pageant() {
}

# Attempt to guess $program's location. For ssh-agent/ssh-add.
function Guess-Ssh($program = 'ssh-agent') {
function Find-Ssh($program = 'ssh-agent') {
Write-Verbose "$program not in path. Trying to guess location."
$gitItem = Get-Command git -Erroraction SilentlyContinue | Get-Item
if ($gitItem -eq $null) { Write-Warning 'git not in path'; return }
Expand All @@ -336,12 +336,12 @@ function Start-SshAgent([switch]$Quiet) {
if ($env:GIT_SSH -imatch 'plink') {
Write-Host "GIT_SSH set to $($env:GIT_SSH), using Pageant as SSH agent."
$pageant = Get-Command pageant -TotalCount 1 -Erroraction SilentlyContinue
$pageant = if ($pageant) {$pageant} else {Guess-Pageant}
$pageant = if ($pageant) {$pageant} else {Find-Pageant}
if (!$pageant) { Write-Warning "Could not find Pageant."; return }
Start-Process -NoNewWindow $pageant
} else {
$sshAgent = Get-Command ssh-agent -TotalCount 1 -ErrorAction SilentlyContinue
$sshAgent = if ($sshAgent) {$sshAgent} else {Guess-Ssh('ssh-agent')}
$sshAgent = if ($sshAgent) {$sshAgent} else {Find-Ssh('ssh-agent')}
if (!$sshAgent) { Write-Warning 'Could not find ssh-agent'; return }

& $sshAgent | foreach {
Expand All @@ -363,7 +363,7 @@ function Get-SshPath($File = 'id_rsa')
function Add-SshKey() {
if ($env:GIT_SSH -imatch 'plink') {
$pageant = Get-Command pageant -Erroraction SilentlyContinue | Select -First 1 -ExpandProperty Name
$pageant = if ($pageant) {$pageant} else {Guess-Pageant}
$pageant = if ($pageant) {$pageant} else {Find-Pageant}
if (!$pageant) { Write-Warning 'Could not find Pageant'; return }

if ($args.Count -eq 0) {
Expand All @@ -379,7 +379,7 @@ function Add-SshKey() {
}
} else {
$sshAdd = Get-Command ssh-add -TotalCount 1 -ErrorAction SilentlyContinue
$sshAdd = if ($sshAdd) {$sshAdd} else {Guess-Ssh('ssh-add')}
$sshAdd = if ($sshAdd) {$sshAdd} else {Find-Ssh('ssh-add')}
if (!$sshAdd) { Write-Warning 'Could not find ssh-add'; return }

if ($args.Count -eq 0) {
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2013 Keith Dahlby and contributors
Copyright (c) 2010-2016 Keith Dahlby and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down

0 comments on commit 0febf54

Please sign in to comment.