Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Equalize git-cmd.bat to cmd/git.cmd
Browse files Browse the repository at this point in the history
This includes reordering some lines and the better fallback-logic for HOME.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  • Loading branch information
sschuberth committed Jul 14, 2010
1 parent e5bf386 commit 4154609
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions git-cmd.bat
@@ -1,7 +1,15 @@
@set PLINK_PROTOCOL=ssh
@rem Do not use "echo off" to not affect any child calls.
@setlocal

@rem Get the abolute path to the current 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;%git_install_root%\cmd;%PATH%
@if "%HOME%"=="" @set HOME=%USERPROFILE%
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%

@if not exist "%HOME%" @set HOME="%HOMEDRIVE%%HOMEPATH%"
@if not exist "%HOME%" @set HOME="%USERPROFILE%"

@set PLINK_PROTOCOL=ssh

@cd %HOME%
@start %COMSPEC%

0 comments on commit 4154609

Please sign in to comment.