summaryrefslogtreecommitdiff
path: root/go/cmd/gitaly-receive-pack/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/cmd/gitaly-receive-pack/main.go')
-rw-r--r--go/cmd/gitaly-receive-pack/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/go/cmd/gitaly-receive-pack/main.go b/go/cmd/gitaly-receive-pack/main.go
index 11a0f7b..9e04347 100644
--- a/go/cmd/gitaly-receive-pack/main.go
+++ b/go/cmd/gitaly-receive-pack/main.go
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
+ "fmt"
"os"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
@@ -19,6 +20,10 @@ func main() {
logger.Fatal("preparation failed", err)
}
+ if n := len(os.Args); n != 3 {
+ logger.Fatal("wrong number of arguments", fmt.Errorf("expected 2 arguments, got %v", os.Args))
+ }
+
var request pb.SSHReceivePackRequest
if err := json.Unmarshal([]byte(os.Args[2]), &request); err != nil {
logger.Fatal("unmarshaling request json failed", err)