From 23b539613001e1552a71cfee507b3ede76c6313f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 15 Jun 2018 22:28:05 +0100 Subject: [PATCH] repo git: Only run chmod for pre-push hook on non-Windows --- Sparkles/Git/GitRepository.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sparkles/Git/GitRepository.cs b/Sparkles/Git/GitRepository.cs index 3f036fa4..e5425483 100644 --- a/Sparkles/Git/GitRepository.cs +++ b/Sparkles/Git/GitRepository.cs @@ -82,11 +82,13 @@ namespace Sparkles.Git { git_config = new GitCommand (LocalPath, "config core.sshCommand " + GitCommand.FormatGitSSHCommand (auth_info)); git_config.StartAndWaitForExit(); - string pre_push_hook_path = Path.Combine (LocalPath, ".git", "hooks", "pre-push"); + if (InstallationInfo.OperatingSystem != OS.Windows) { + string pre_push_hook_path = Path.Combine (LocalPath, ".git", "hooks", "pre-push"); - // TODO: Use proper API - var chmod = new Command ("chmod", "700 " + pre_push_hook_path); - chmod.StartAndWaitForExit (); + // TODO: Use proper API + var chmod = new Command ("chmod", "700 " + pre_push_hook_path); + chmod.StartAndWaitForExit (); + } }