Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/git/hooks/hooks_test.go')
-rw-r--r--internal/git/hooks/hooks_test.go20
1 files changed, 3 insertions, 17 deletions
diff --git a/internal/git/hooks/hooks_test.go b/internal/git/hooks/hooks_test.go
index 655366b7d..ce6989636 100644
--- a/internal/git/hooks/hooks_test.go
+++ b/internal/git/hooks/hooks_test.go
@@ -1,8 +1,6 @@
package hooks
import (
- "fmt"
- "os"
"testing"
"github.com/stretchr/testify/require"
@@ -10,27 +8,15 @@ import (
)
func TestPath(t *testing.T) {
- defer func(rubyDir, shellDir string) {
+ defer func(rubyDir string) {
config.Config.Ruby.Dir = rubyDir
- config.Config.GitlabShell.Dir = shellDir
- }(config.Config.Ruby.Dir, config.Config.GitlabShell.Dir)
+ }(config.Config.Ruby.Dir)
config.Config.Ruby.Dir = "/bazqux/gitaly-ruby"
- config.Config.GitlabShell.Dir = "/foobar/gitlab-shell"
-
- hooksVar := "GITALY_USE_EMBEDDED_HOOKS"
- t.Run(fmt.Sprintf("with %s=1", hooksVar), func(t *testing.T) {
- os.Setenv(hooksVar, "1")
- defer os.Unsetenv(hooksVar)
+ t.Run("default", func(t *testing.T) {
require.Equal(t, "/bazqux/gitaly-ruby/git-hooks", Path())
})
- t.Run(fmt.Sprintf("without %s=1", hooksVar), func(t *testing.T) {
- os.Unsetenv(hooksVar)
-
- require.Equal(t, "/foobar/gitlab-shell/hooks", Path())
- })
-
t.Run("with an override", func(t *testing.T) {
Override = "/override/hooks"
defer func() { Override = "" }()