Skip to content

Commit 4e38982

Browse files
authored
[flutter_tools] Fix $git typo in shared.bat to restore cache invalidation on Windows (flutter#191217)
## Description In `bin/internal/shared.bat`, a typo (`$git` instead of `git`) prevented the batch script from obtaining the current Git revision on Windows. Because errors were redirected to `2>NUL`, this failure occurred silently, and the compile stamp file (`bin\cache\flutter_tools.stamp`) was always written as `:`. This broke the caching mechanism that ensures `flutter_tools` is recompiled when checking out a different Flutter SDK revision. This PR fixes the typo, wraps `%FLUTTER_ROOT%` in double quotes in the `PUSHD` command to handle directory paths with spaces, and chains with `&&` so `git rev-parse HEAD` is only executed if `PUSHD` succeeds. ## Related Issues Fixes flutter#187907 ## Tests - None: trivial syntax fix to Windows launcher batch script (`shared.bat`).
1 parent 0cb3b7e commit 4e38982

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎bin/internal/shared.bat‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ GOTO :after_subroutine
7272
REM before getting the git revision.
7373
REM
7474
REM See https://github.com/flutter/flutter/issues/159018
75-
FOR /f %%r IN ('PUSHD %FLUTTER_ROOT% ^& $git rev-parse HEAD') DO (
75+
FOR /f %%r IN ('PUSHD "%FLUTTER_ROOT%" ^&^& git rev-parse HEAD') DO (
7676
SET revision=%%r
7777
)
7878
)

0 commit comments

Comments
 (0)