From 22f8eda82978970c9a7c467afcab98b0e729db5d Mon Sep 17 00:00:00 2001 From: Jeremiah Snapp Date: Tue, 7 Jan 2020 16:20:40 -0500 Subject: [PATCH] Escape /C to workaround a bug in Git for Windows 2.24.1.2 This change works with Git for Windows 2.24.1.2 and backwards compatibility test with 2.22.0 was also successful. https://github.com/git-for-windows/git/issues/2442 Signed-off-by: Jeremiah Snapp --- hooks/command | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/command b/hooks/command index 635d32d..2d24f03 100755 --- a/hooks/command +++ b/hooks/command @@ -79,7 +79,9 @@ if is_windows ; then init_default='' mount_agent_default='' workdir_default="C:\\workdir" - pwd_default="$(cmd.exe /C "echo %CD%")" + # escaping /C is a necessary workaround for an issue with Git for Windows 2.24.1.2 + # https://github.com/git-for-windows/git/issues/2442 + pwd_default="$(cmd.exe //C "echo %CD%")" elif is_macos ; then mount_agent_default='' fi