repo git: Only run chmod for pre-push hook on non-Windows

This commit is contained in:
Hylke Bons 2018-06-15 22:28:05 +01:00
parent 214a383923
commit 99b6761acf

View file

@ -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 ();
}
}