Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 @rem Do not use "echo off" to not affect any child calls. | 1 @rem Do not use "echo off" to not affect any child calls. |
| 2 @setlocal | 2 @setlocal |
| 3 | 3 |
| 4 @rem Get the abolute path to the parent directory, which is assumed to be the | 4 @rem Get the abolute path to the parent directory, which is assumed to be the |
| 5 @rem Git installation root. | 5 @rem Git installation root. |
| 6 @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI | 6 @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI |
| 7 @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH% | 7 @set PATH=%git_install_root%\cmd;%git_install_root%\bin;%PATH% |
|
cmp
2012/11/08 22:35:58
Your description didn't mention what happened to m
| |
| 8 | 8 |
| 9 :: Set the HOME variable to depot_tools (the parent of this directory's parent). | 9 :: Set the HOME variable to depot_tools (the parent of this directory's parent). |
| 10 @if not exist "%HOME%" @for /F "delims=" %%I in ("%~dp0..\..") do @set HOME=%%~f I | 10 @if not exist "%HOME%" @for /F "delims=" %%I in ("%~dp0..\..") do @set HOME=%%~f I |
| 11 :: Set GIT_SSH to ssh.cmd in the same directory. | 11 :: Set GIT_SSH to ssh.cmd in the same directory. |
| 12 @if not exist "%GIT_SSH%" @set GIT_SSH=%~dp0ssh.cmd | 12 @if not exist "%GIT_SSH%" @set GIT_SSH=%~dp0ssh.cmd |
| 13 @set PLINK_PROTOCOL=%~dp0ssh.cmd | 13 @set PLINK_PROTOCOL=%~dp0ssh.cmd |
| 14 | 14 |
| 15 @if "%1"=="gui" @goto gui | 15 @if "%1"=="gui" @goto gui |
| 16 | 16 |
| 17 :default | 17 :default |
| 18 @rem Get the current console ("OEM") codepage. | 18 @rem Get the current console ("OEM") codepage. |
| 19 @for /f %%i in ('getcp -oem') do @set cp_oem=%%i | 19 @for /f %%i in ('getcp -oem') do @set cp_oem=%%i |
| 20 @rem Get the current GUI ("ANSI") codepage. | 20 @rem Get the current GUI ("ANSI") codepage. |
| 21 @for /f %%i in ('getcp -ansi') do @set cp_ansi=%%i | 21 @for /f %%i in ('getcp -ansi') do @set cp_ansi=%%i |
| 22 @rem Set the console codepage to match the GUI codepage. | 22 @rem Set the console codepage to match the GUI codepage. |
| 23 @chcp %cp_ansi% > nul < nul | 23 @chcp %cp_ansi% > nul < nul |
| 24 @git.exe %* | 24 @git.exe %* |
| 25 @set ErrorLevel=%ErrorLevel% | 25 @set ErrorLevel=%ErrorLevel% |
| 26 @rem Restore the original console codepage. | 26 @rem Restore the original console codepage. |
| 27 @chcp %cp_oem% > nul < nul | 27 @chcp %cp_oem% > nul < nul |
| 28 @goto quit | 28 @goto quit |
| 29 | 29 |
| 30 :gui | 30 :gui |
| 31 @if "%2"=="citool" @goto default | 31 @if "%2"=="citool" @goto default |
| 32 @for /f "tokens=1-1*" %%a in ("%*") do @set args=%%b | 32 @for /f "tokens=1-1*" %%a in ("%*") do @set args=%%b |
| 33 @start "git-gui" wish.exe "%git_install_root%\libexec\git-core\git-gui" -- %args % | 33 @start "git-gui" wish.exe "%git_install_root%\libexec\git-core\git-gui" -- %args % |
| 34 | 34 |
| 35 :quit | 35 :quit |
| 36 @"%COMSPEC%" /c exit /b %ErrorLevel% | 36 @"%COMSPEC%" /c exit /b %ErrorLevel% |
| OLD | NEW |