summaryrefslogtreecommitdiff
path: root/standalone
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-08 14:03:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-08 14:26:37 -0400
commit51ffddd49c884144e9f9520a3e997a65a94aa57e (patch)
tree7f862d206c2903db3ed9189098db742e5de2647b /standalone
parentd1c76795790313c4036e6684886bb8ac03c6b8eb (diff)
use a batch file to run msysgit's ssh, instead of copying
copying failed because dlls are not in path. This batch file is based on the one msysgit uses to start gitk
Diffstat (limited to 'standalone')
-rw-r--r--standalone/windows/ssh.cmd31
1 files changed, 31 insertions, 0 deletions
diff --git a/standalone/windows/ssh.cmd b/standalone/windows/ssh.cmd
new file mode 100644
index 000000000..32aa60a4d
--- /dev/null
+++ b/standalone/windows/ssh.cmd
@@ -0,0 +1,31 @@
+@rem Do not use "echo off" to not affect any child calls.
+
+@rem Enable extensions, the `verify other 2>nul` is a trick from the setlocal help
+@verify other 2>nul
+@setlocal enableDelayedExpansion
+@if errorlevel 1 (
+ @echo Unable to enable delayed expansion. Immediate expansion will be used.
+ @goto fallback
+)
+
+@rem Get the absolute path to the parent directory, which is assumed to be the
+@rem Git installation root.
+@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
+@set PATH=!git_install_root!\bin;!git_install_root!\mingw\bin;!PATH!
+
+ssh %*
+@goto end
+
+:fallback
+@rem The above script again with immediate expansion, in case delayed expansion
+@rem is unavailable.
+@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
+@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
+
+@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
+@if not exist "%HOME%" @set HOME=%USERPROFILE%
+
+ssh %*
+
+:end
+@rem End of script