From 24acf27f48823004c2a8fb37eef330f0419fdfec Mon Sep 17 00:00:00 2001 From: William Hesse Date: Mon, 16 May 2022 17:11:52 +0200 Subject: [PATCH] Use git.bat from depot_tools in githooks setup on Windows (flutter/engine#33389) The git installed by depot_tools on Windows is only available as git.bat from Python. The shell auto-replaces git by git.bat, but that doesn't happen when running from Python. The git installed by depot_tools may be the only git installed on Windows. Without this fix, gclient sync does not work on Windows for me --- engine/src/flutter/tools/githooks/setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/tools/githooks/setup.py b/engine/src/flutter/tools/githooks/setup.py index 66c105d051d..e045f0a2693 100755 --- a/engine/src/flutter/tools/githooks/setup.py +++ b/engine/src/flutter/tools/githooks/setup.py @@ -22,11 +22,13 @@ def IsWindows(): def Main(argv): + git = 'git' githooks = os.path.join(FLUTTER_DIR, 'tools', 'githooks') if IsWindows(): + git = 'git.bat' githooks = os.path.join(githooks, 'windows') result = subprocess.run([ - 'git', + git, 'config', 'core.hooksPath', githooks,