Fix command prompt title after update_depot_tools

Windows has a bug where it sometimes doesn't reset the command prompt
title when a batch file finishes executing. A simple repro is shown
here:

b1.bat:
echo In b1
if 1 == 1 (
  b2.bat
)

b2.bat:
echo In b2

If you run b1.bat then "b1" will stay as the title when the batch files
finish running. The solution is to use "call" followed by "exit".

This bug is particularly annoying when using tabs in the new Windows
Terminal. By working around the bug this makes it so that the tab titles
return to being useful indicators of when a batch file is completed.

A previous fix of this bug (in a different batch file) can be seen in
crrev.com/c/2133303.

Change-Id: Id563f3102751a91f46c5b25ce610af9ec7ab240a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2225340
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
diff --git a/update_depot_tools.bat b/update_depot_tools.bat
index 4311f20..4df4d44 100644
--- a/update_depot_tools.bat
+++ b/update_depot_tools.bat
@@ -13,7 +13,9 @@
 IF "%~nx0"=="update_depot_tools.bat" (

   COPY /Y "%~dp0update_depot_tools.bat" "%TEMP%\update_depot_tools_tmp.bat" >nul

   if errorlevel 1 goto :EOF

-  "%TEMP%\update_depot_tools_tmp.bat" "%~dp0" %*

+  REM Use call/exit to avoid leaving an orphaned window title.

+  call "%TEMP%\update_depot_tools_tmp.bat" "%~dp0" %*

+  exit /b

 )

 

 set DEPOT_TOOLS_DIR=%~1