summaryrefslogtreecommitdiff
path: root/go/internal/command/command_test.go
diff options
context:
space:
mode:
authorIgor <idrozdov@gitlab.com>2019-06-03 15:21:25 +0000
committerNick Thomas <nick@gitlab.com>2019-06-03 15:21:25 +0000
commitcde5b73cb8776c70c6d00ff34c568ea4438bcba9 (patch)
treeddc0d81da81ebfdb2c05819c88cde2c56dbaf4d5 /go/internal/command/command_test.go
parentbeb5855542645cdc9bf7f954b9c5a9333dfb3975 (diff)
downloadgitlab-shell-cde5b73cb8776c70c6d00ff34c568ea4438bcba9.tar.gz
Go implementation for git-upload-pack
Diffstat (limited to 'go/internal/command/command_test.go')
-rw-r--r--go/internal/command/command_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/go/internal/command/command_test.go b/go/internal/command/command_test.go
index cdcda8a..37db89f 100644
--- a/go/internal/command/command_test.go
+++ b/go/internal/command/command_test.go
@@ -9,6 +9,7 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/fallback"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/receivepack"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/twofactorrecover"
+ "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/uploadpack"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/testhelper"
)
@@ -69,6 +70,18 @@ func TestNew(t *testing.T) {
expectedType: &receivepack.Command{},
},
{
+ desc: "it returns a UploadPack command if the feature is enabled",
+ config: &config.Config{
+ GitlabUrl: "http+unix://gitlab.socket",
+ Migration: config.MigrationConfig{Enabled: true, Features: []string{"git-upload-pack"}},
+ },
+ environment: map[string]string{
+ "SSH_CONNECTION": "1",
+ "SSH_ORIGINAL_COMMAND": "git-upload-pack",
+ },
+ expectedType: &uploadpack.Command{},
+ },
+ {
desc: "it returns a Fallback command if the feature is unimplemented",
config: &config.Config{
GitlabUrl: "http+unix://gitlab.socket",