Skip to content

Commit 02d4f0f

Browse files
committed
Fix lint
1 parent e5b8200 commit 02d4f0f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/gitrepo/http.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ import (
1313
)
1414

1515
func serviceCmd(service string) *git.Command {
16-
if service == "git-receive-pack" {
16+
switch service {
17+
case "git-receive-pack":
1718
return git.NewCommand("git-receive-pack")
19+
case "git-upload-pack":
20+
return git.NewCommand("git-upload-pack")
21+
default:
22+
// the service should be checked before invoking this function
23+
panic("unknown service: " + service)
1824
}
19-
return git.NewCommand("git-upload-pack")
2025
}
2126

2227
func StatelessRPC(ctx context.Context, storageRepo Repository, service string, extraEnvs []string, input io.Reader, output io.Writer) (string, error) {

0 commit comments

Comments
 (0)