Skip to content

Commit 4154609

Browse files
committed
Equalize git-cmd.bat to cmd/git.cmd
This includes reordering some lines and the better fallback-logic for HOME. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent e5bf386 commit 4154609

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

git-cmd.bat

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
@set PLINK_PROTOCOL=ssh
1+
@rem Do not use "echo off" to not affect any child calls.
22
@setlocal
3+
4+
@rem Get the abolute path to the current directory, which is assumed to be the
5+
@rem Git installation root.
36
@for /F "delims=" %%I in ("%~dp0") do @set git_install_root=%%~fI
4-
@set path=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%
5-
@if "%HOME%"=="" @set HOME=%USERPROFILE%
7+
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%
8+
9+
@if not exist "%HOME%" @set HOME="%HOMEDRIVE%%HOMEPATH%"
10+
@if not exist "%HOME%" @set HOME="%USERPROFILE%"
11+
12+
@set PLINK_PROTOCOL=ssh
13+
614
@cd %HOME%
715
@start %COMSPEC%

0 commit comments

Comments
 (0)