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
8db304b4
Commit
8db304b4
authored
Oct 10, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some unneeded binaries
parent
c88d80fe
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
286 deletions
+0
-286
.gitignore
.gitignore
+0
-4
go/cmd/gitaly-receive-pack/main.go
go/cmd/gitaly-receive-pack/main.go
+0
-35
go/cmd/gitaly-receive-pack/main_test.go
go/cmd/gitaly-receive-pack/main_test.go
+0
-59
go/cmd/gitaly-upload-archive/main.go
go/cmd/gitaly-upload-archive/main.go
+0
-35
go/cmd/gitaly-upload-archive/main_test.go
go/cmd/gitaly-upload-archive/main_test.go
+0
-59
go/cmd/gitaly-upload-pack/main.go
go/cmd/gitaly-upload-pack/main.go
+0
-35
go/cmd/gitaly-upload-pack/main_test.go
go/cmd/gitaly-upload-pack/main_test.go
+0
-59
No files found.
.gitignore
View file @
8db304b4
...
...
@@ -4,7 +4,6 @@ tmp/*
*.log
/*.log*
authorized_keys.lock
coverage/
.gitlab_shell_secret
.bundle
tags
...
...
@@ -15,7 +14,4 @@ hooks/*.d
/bin/gitlab-shell
/bin/gitlab-shell-authorized-keys-check
/bin/gitlab-shell-authorized-principals-check
/bin/gitaly-upload-pack
/bin/gitaly-receive-pack
/bin/gitaly-upload-archive
/bin/check
go/cmd/gitaly-receive-pack/main.go
deleted
100644 → 0
View file @
c88d80fe
package
main
import
(
"context"
"encoding/json"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/logger"
"google.golang.org/grpc"
pb
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func
init
()
{
logger
.
ProgName
=
"gitaly-receive-pack"
}
func
main
()
{
handler
.
RunGitalyCommand
(
func
(
ctx
context
.
Context
,
conn
*
grpc
.
ClientConn
,
requestJSON
string
)
(
int32
,
error
)
{
request
,
err
:=
deserialize
(
requestJSON
)
if
err
!=
nil
{
return
1
,
err
}
return
handler
.
ReceivePack
(
ctx
,
conn
,
request
)
})
}
func
deserialize
(
requestJSON
string
)
(
*
pb
.
SSHReceivePackRequest
,
error
)
{
var
request
pb
.
SSHReceivePackRequest
if
err
:=
json
.
Unmarshal
([]
byte
(
requestJSON
),
&
request
);
err
!=
nil
{
return
nil
,
err
}
return
&
request
,
nil
}
go/cmd/gitaly-receive-pack/main_test.go
deleted
100644 → 0
View file @
c88d80fe
package
main
import
(
"testing"
"github.com/stretchr/testify/require"
pb
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func
Test_deserialize
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
requestJSON
string
want
*
pb
.
SSHReceivePackRequest
wantErr
bool
}{
{
name
:
"empty"
,
requestJSON
:
""
,
want
:
nil
,
wantErr
:
true
,
},
{
name
:
"empty_hash"
,
requestJSON
:
"{}"
,
want
:
&
pb
.
SSHReceivePackRequest
{},
wantErr
:
false
,
},
{
name
:
"nil"
,
requestJSON
:
"null"
,
want
:
&
pb
.
SSHReceivePackRequest
{},
wantErr
:
false
,
},
{
name
:
"values"
,
requestJSON
:
`{"gl_id": "1234"}`
,
want
:
&
pb
.
SSHReceivePackRequest
{
GlId
:
"1234"
},
wantErr
:
false
,
},
{
name
:
"invalid_json"
,
requestJSON
:
`{"gl_id": "1234`
,
want
:
nil
,
wantErr
:
true
,
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
got
,
err
:=
deserialize
(
tt
.
requestJSON
)
require
.
EqualValues
(
t
,
got
,
tt
.
want
,
"Got %+v, wanted %+v"
,
got
,
tt
.
want
)
if
tt
.
wantErr
{
require
.
Error
(
t
,
err
,
"Wanted an error, got %+v"
,
err
)
}
else
{
require
.
NoError
(
t
,
err
,
"Wanted no error, got %+v"
,
err
)
}
})
}
}
go/cmd/gitaly-upload-archive/main.go
deleted
100644 → 0
View file @
c88d80fe
package
main
import
(
"context"
"encoding/json"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/logger"
"google.golang.org/grpc"
pb
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func
init
()
{
logger
.
ProgName
=
"gitaly-upload-archive"
}
func
main
()
{
handler
.
RunGitalyCommand
(
func
(
ctx
context
.
Context
,
conn
*
grpc
.
ClientConn
,
requestJSON
string
)
(
int32
,
error
)
{
request
,
err
:=
deserialize
(
requestJSON
)
if
err
!=
nil
{
return
1
,
err
}
return
handler
.
UploadArchive
(
ctx
,
conn
,
request
)
})
}
func
deserialize
(
argumentJSON
string
)
(
*
pb
.
SSHUploadArchiveRequest
,
error
)
{
var
request
pb
.
SSHUploadArchiveRequest
if
err
:=
json
.
Unmarshal
([]
byte
(
argumentJSON
),
&
request
);
err
!=
nil
{
return
nil
,
err
}
return
&
request
,
nil
}
go/cmd/gitaly-upload-archive/main_test.go
deleted
100644 → 0
View file @
c88d80fe
package
main
import
(
"testing"
"github.com/stretchr/testify/require"
pb
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func
Test_deserialize
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
requestJSON
string
want
*
pb
.
SSHUploadArchiveRequest
wantErr
bool
}{
{
name
:
"empty"
,
requestJSON
:
""
,
want
:
nil
,
wantErr
:
true
,
},
{
name
:
"empty_hash"
,
requestJSON
:
"{}"
,
want
:
&
pb
.
SSHUploadArchiveRequest
{},
wantErr
:
false
,
},
{
name
:
"nil"
,
requestJSON
:
"null"
,
want
:
&
pb
.
SSHUploadArchiveRequest
{},
wantErr
:
false
,
},
{
name
:
"values"
,
requestJSON
:
`{"repository": { "storage_name": "12345"} }`
,
want
:
&
pb
.
SSHUploadArchiveRequest
{
Repository
:
&
pb
.
Repository
{
StorageName
:
"12345"
}},
wantErr
:
false
,
},
{
name
:
"invalid_json"
,
requestJSON
:
`{"gl_id": "1234`
,
want
:
nil
,
wantErr
:
true
,
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
got
,
err
:=
deserialize
(
tt
.
requestJSON
)
require
.
EqualValues
(
t
,
got
,
tt
.
want
,
"Got %+v, wanted %+v"
,
got
,
tt
.
want
)
if
tt
.
wantErr
{
require
.
Error
(
t
,
err
,
"Wanted an error, got %+v"
,
err
)
}
else
{
require
.
NoError
(
t
,
err
,
"Wanted no error, got %+v"
,
err
)
}
})
}
}
go/cmd/gitaly-upload-pack/main.go
deleted
100644 → 0
View file @
c88d80fe
package
main
import
(
"context"
"encoding/json"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/handler"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/logger"
"google.golang.org/grpc"
pb
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func
init
()
{
logger
.
ProgName
=
"gitaly-upload-pack"
}
func
main
()
{
handler
.
RunGitalyCommand
(
func
(
ctx
context
.
Context
,
conn
*
grpc
.
ClientConn
,
requestJSON
string
)
(
int32
,
error
)
{
request
,
err
:=
deserialize
(
requestJSON
)
if
err
!=
nil
{
return
1
,
err
}
return
handler
.
UploadPack
(
ctx
,
conn
,
request
)
})
}
func
deserialize
(
requestJSON
string
)
(
*
pb
.
SSHUploadPackRequest
,
error
)
{
var
request
pb
.
SSHUploadPackRequest
if
err
:=
json
.
Unmarshal
([]
byte
(
requestJSON
),
&
request
);
err
!=
nil
{
return
nil
,
err
}
return
&
request
,
nil
}
go/cmd/gitaly-upload-pack/main_test.go
deleted
100644 → 0
View file @
c88d80fe
package
main
import
(
"testing"
"github.com/stretchr/testify/require"
pb
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
func
Test_deserialize
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
requestJSON
string
want
*
pb
.
SSHUploadPackRequest
wantErr
bool
}{
{
name
:
"empty"
,
requestJSON
:
""
,
want
:
nil
,
wantErr
:
true
,
},
{
name
:
"empty_hash"
,
requestJSON
:
"{}"
,
want
:
&
pb
.
SSHUploadPackRequest
{},
wantErr
:
false
,
},
{
name
:
"nil"
,
requestJSON
:
"null"
,
want
:
&
pb
.
SSHUploadPackRequest
{},
wantErr
:
false
,
},
{
name
:
"values"
,
requestJSON
:
`{"repository": { "storage_name": "12345"} }`
,
want
:
&
pb
.
SSHUploadPackRequest
{
Repository
:
&
pb
.
Repository
{
StorageName
:
"12345"
}},
wantErr
:
false
,
},
{
name
:
"invalid_json"
,
requestJSON
:
`{"gl_id": "1234`
,
want
:
nil
,
wantErr
:
true
,
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
got
,
err
:=
deserialize
(
tt
.
requestJSON
)
require
.
EqualValues
(
t
,
got
,
tt
.
want
,
"Got %+v, wanted %+v"
,
got
,
tt
.
want
)
if
tt
.
wantErr
{
require
.
Error
(
t
,
err
,
"Wanted an error, got %+v"
,
err
)
}
else
{
require
.
NoError
(
t
,
err
,
"Wanted no error, got %+v"
,
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