Commit 4741a127 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Tweak git bat template

This fixes some issues with escaping, namely carets. For example,
without this patch, when HEAD^^1 is passed to batch script, it will
forward HEAD1 to git. With this patch, it will be forwarded as HEAD^^1
to git. There is still issue with HEAD^1 which seems not possible to fix
with batch script as batch receives HEAD1.

R=ehmaldonado@chromium.org

Change-Id: Ibb48ef06b4f17df374ee983eaa19ca43a706fa22
Bug: 1065307
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2130635
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
parent 845b8305
......@@ -2,4 +2,19 @@
setlocal
if not defined EDITOR set EDITOR=notepad
set PATH=%~dp0${GIT_BIN_RELDIR}\cmd;%~dp0;%PATH%
"%~dp0${GIT_BIN_RELDIR}\${GIT_PROGRAM}" %*
REM This hack tries to restore as many original arguments as possible
REM "HEAD^^1" is parsed correctly, but "HEAD^1" is still not.
REM TODO(crbug.com/1066663): Fix passing "HEAD^1" as argument.
call :RunGit "%*"
REM exit /b from call :RunGit won't be sent to the prompt.
if %ERRORLEVEL% NEQ 0 (
exit /b %ERRORLEVEL%
)
goto :eof
:RunGit
call "%~dp0${GIT_BIN_RELDIR}\${GIT_PROGRAM}" %~1
if %ERRORLEVEL% NEQ 0 (
exit /b %ERRORLEVEL%
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment