diff options
Diffstat (limited to 'internal/git/hooks/hooks.go')
-rw-r--r-- | internal/git/hooks/hooks.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/git/hooks/hooks.go b/internal/git/hooks/hooks.go index 9357f0fe5..c77c3ed1e 100644 --- a/internal/git/hooks/hooks.go +++ b/internal/git/hooks/hooks.go @@ -10,18 +10,18 @@ import ( // Override allows tests to control where the hooks directory is. var Override string -// Path returns the path where the global git hooks are located. As a -// transitional mechanism, GITALY_USE_EMBEDDED_HOOKS=1 will cause -// Gitaly's embedded hooks to be used instead of the legacy gitlab-shell -// hooks. +// Path returns the path where the global git hooks are located. If the +// environment variable GITALY_TESTING_NO_GIT_HOOKS is set to "1", Path +// will return an empty directory, which has the effect that no Git hooks +// will run at all. func Path() string { if len(Override) > 0 { return Override } - if os.Getenv("GITALY_USE_EMBEDDED_HOOKS") == "1" { - return path.Join(config.Config.Ruby.Dir, "git-hooks") + if os.Getenv("GITALY_TESTING_NO_GIT_HOOKS") == "1" { + return "/var/empty" } - return path.Join(config.Config.GitlabShell.Dir, "hooks") + return path.Join(config.Config.Ruby.Dir, "git-hooks") } |