From 6ff53334cdc12e7e584a0852088709e62a0c4c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eckl=2C=20M=C3=A1t=C3=A9?= Date: Thu, 27 Jul 2017 22:44:27 +0200 Subject: [PATCH] Removed fix config flag from default hooks This modification makes repos more flexible in the aspect of moving them, or the config. I had an issue because of this. As setting contains default config path this solution made it unnecessarily unflexible. --- models/repo.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/repo.go b/models/repo.go index 998914d5b..3033714db 100644 --- a/models/repo.go +++ b/models/repo.go @@ -771,16 +771,16 @@ func cleanUpMigrateGitConfig(configPath string) error { } var hooksTpls = map[string]string{ - "pre-receive": "#!/usr/bin/env %s\n\"%s\" hook --config='%s' pre-receive\n", - "update": "#!/usr/bin/env %s\n\"%s\" hook --config='%s' update $1 $2 $3\n", - "post-receive": "#!/usr/bin/env %s\n\"%s\" hook --config='%s' post-receive\n", + "pre-receive": "#!/usr/bin/env %s\n\"%s\" hook pre-receive\n", + "update": "#!/usr/bin/env %s\n\"%s\" hook update $1 $2 $3\n", + "post-receive": "#!/usr/bin/env %s\n\"%s\" hook post-receive\n", } func createDelegateHooks(repoPath string) (err error) { for _, name := range git.HookNames { hookPath := filepath.Join(repoPath, "hooks", name) if err = ioutil.WriteFile(hookPath, - []byte(fmt.Sprintf(hooksTpls[name], setting.ScriptType, setting.AppPath, setting.CustomConf)), + []byte(fmt.Sprintf(hooksTpls[name], setting.ScriptType, setting.AppPath)), os.ModePerm); err != nil { return fmt.Errorf("create delegate hook '%s': %v", hookPath, err) }