Shorten hook download command

Quote argument, so it works with paths that have spaces.

Change-Id: I9254b309073a09b7751bafe6ef895bff72e0498d
This commit is contained in:
Han-Wen Nienhuys
2018-07-25 19:05:29 +02:00
parent db485a11f3
commit 60df703080

View File

@@ -359,10 +359,9 @@ public class CommitValidators {
// If there are no SSH keys, the commit-msg hook must be installed via
// HTTP(S)
if (hostKeys.isEmpty()) {
String p = "${gitdir}/hooks/commit-msg";
return String.format(
" gitdir=$(git rev-parse --git-dir); curl -o %s %stools/hooks/commit-msg ; chmod +x %s",
p, canonicalWebUrl, p);
" f=\"$(git rev-parse --git-dir)/hooks/commit-msg\"; curl -o \"$f\" %stools/hooks/commit-msg ; chmod +x \"$f\"",
canonicalWebUrl);
}
// SSH keys exist, so the hook can be installed with scp.