From 33abb1c093ca6a680426016473da7def813beb1e Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 16 Nov 2022 17:00:51 -0500 Subject: [PATCH] fix(server): ignore request if it's not a git command --- server/git/ssh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/git/ssh.go b/server/git/ssh.go index d8aa7c37ba9273289f5443b792133eaaf14a70b4..6aa5f83de3f5e9ae00efc76588d7586a24d9cb58 100644 --- a/server/git/ssh.go +++ b/server/git/ssh.go @@ -76,7 +76,7 @@ func Middleware(repoDir string, gh Hooks) wish.Middleware { return func(s ssh.Session) { func() { cmd := s.Command() - if len(cmd) == 2 { + if len(cmd) == 2 && strings.HasPrefix(cmd[0], "git") { gc := cmd[0] // repo should be in the form of "repo.git" repo := strings.TrimPrefix(cmd[1], "/")