From 9db428f4f78ea6eebea783850f889a55d8f6a948 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Thu, 2 Apr 2020 00:01:12 +0000 Subject: [PATCH] Revert "Tweak git bat template" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4741a1279733c100cd0be0721d0b9eb6f51ca114. Reason for revert: % is escaped improperly Bug: 1067065 Original change's description: > 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 > Reviewed-by: Edward Lesmes > Auto-Submit: Josip Sokcevic TBR=ehmaldonado@chromium.org,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com Change-Id: Ib46517010fd49621b758fc9594cbd90f7ff4e89a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 1065307 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2133309 Reviewed-by: Josip Sokcevic Commit-Queue: Josip Sokcevic --- bootstrap/git.template.bat | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/bootstrap/git.template.bat b/bootstrap/git.template.bat index 64ad6c574..02572887a 100644 --- a/bootstrap/git.template.bat +++ b/bootstrap/git.template.bat @@ -2,19 +2,4 @@ setlocal if not defined EDITOR set EDITOR=notepad set PATH=%~dp0${GIT_BIN_RELDIR}\cmd;%~dp0;%PATH% - -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% -) +"%~dp0${GIT_BIN_RELDIR}\${GIT_PROGRAM}" %*