Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
e3dc9c76
Commit
e3dc9c76
authored
May 03, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check number of arguments
parent
33d583bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
go/cmd/gitaly-receive-pack/main.go
go/cmd/gitaly-receive-pack/main.go
+5
-0
go/cmd/gitaly-upload-pack/main.go
go/cmd/gitaly-upload-pack/main.go
+5
-0
No files found.
go/cmd/gitaly-receive-pack/main.go
View file @
e3dc9c76
...
...
@@ -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
)
...
...
go/cmd/gitaly-upload-pack/main.go
View file @
e3dc9c76
...
...
@@ -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
.
SSHUploadPackRequest
if
err
:=
json
.
Unmarshal
([]
byte
(
os
.
Args
[
2
]),
&
request
);
err
!=
nil
{
logger
.
Fatal
(
"unmarshaling request json failed"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment