From 99e188db8f44fabb85a0b848d2419b101136db51 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 16 Jun 2018 12:41:13 +0100 Subject: [PATCH] git fetcher: Chmod pre-push hook after clone --- Sparkles/Git/GitFetcher.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sparkles/Git/GitFetcher.cs b/Sparkles/Git/GitFetcher.cs index 1199e989..221a5af0 100644 --- a/Sparkles/Git/GitFetcher.cs +++ b/Sparkles/Git/GitFetcher.cs @@ -440,6 +440,14 @@ namespace Sparkles.Git { git_config_required.StartAndWaitForExit (); git_config_clean.StartAndWaitForExit (); git_config_smudge.StartAndWaitForExit (); + + if (InstallationInfo.OperatingSystem != OS.Windows) { + string pre_push_hook_path = Path.Combine (TargetFolder, ".git", "hooks", "pre-push"); + + // TODO: Use proper API + var chmod = new Command ("chmod", "700 " + pre_push_hook_path); + chmod.StartAndWaitForExit (); + } } } }