Skip to content

Commit

Permalink
Escape /C to workaround a bug in Git for Windows 2.24.1.2
Browse files Browse the repository at this point in the history
This change works with Git for Windows 2.24.1.2 and backwards
compatibility test with 2.22.0 was also successful.

git-for-windows/git#2442
Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
  • Loading branch information
jeremiahsnapp committed Jan 7, 2020
1 parent 6a2b850 commit 22f8eda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 22f8eda

Please sign in to comment.