Permalink
Browse files

Update path to TortoiseProc to reflect rename.

TortoiseGit 1.8.0 renamed TortoiseProc to TortoiseGitProc, which caused a
bug in posh-git where calling tgit would throw an exception (could not
find TortoiseProc.exe).

This commit fixes that bug, by testing whether TortoiseGitProc exists and
using that if it does.  If it does not exist, then the default
TortoiseProc is used instead.
  • Loading branch information...
1 parent 198f2ab commit c3255c2ab8f3ad4826a13ae3a8f8a1d978a33eef Alastair Smith committed Jan 29, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 TortoiseGit.ps1
View
@@ -1,7 +1,16 @@
# TortoiseGit
+function private:Get-TortoiseGitPath {
+ if ((Test-Path "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe") -eq $true) {
+ # TortoiseGit 1.8.0 renamed TortoiseProc to TortoiseGitProc.
+ return "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe"
+ }
+
+ return "C:\Program Files\TortoiseGit\bin\TortoiseProc.exe"
+}
+
$Global:TortoiseGitSettings = new-object PSObject -Property @{
- TortoiseGitPath = "C:\Program Files\TortoiseGit\bin\TortoiseProc.exe"
+ TortoiseGitPath = (Get-TortoiseGitPath)
}
function tgit {

0 comments on commit c3255c2

Please sign in to comment.