summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2020-03-26 20:54:04 -0700
committerStan Hu <stanhu@gmail.com>2020-03-26 20:54:04 -0700
commit90fe3a0bd925be0272d92f3ac6f555dd5837cf9e (patch)
tree80ab6b3e7691066cdde96e725a1f9fb5948715fe
parentf1ec61c73087f08d76bc3f117dc169a30e5a13f6 (diff)
downloadgitlab-shell-90fe3a0bd925be0272d92f3ac6f555dd5837cf9e.tar.gz
Add git-archive-pack
-rw-r--r--internal/command/receivepack/gitalycall.go12
-rw-r--r--internal/command/uploadarchive/gitalycall.go11
-rw-r--r--internal/command/uploadpack/gitalycall.go12
3 files changed, 23 insertions, 12 deletions
diff --git a/internal/command/receivepack/gitalycall.go b/internal/command/receivepack/gitalycall.go
index de41b25..8a9b4ba 100644
--- a/internal/command/receivepack/gitalycall.go
+++ b/internal/command/receivepack/gitalycall.go
@@ -33,12 +33,12 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error {
}
fields := log.Fields{
- "command": "git-receive-pack",
- "gl_project_path": request.Repository.GlProjectPath,
- "gl_repository": request.Repository.GlRepository,
- "user_id": response.UserId,
- "username": response.Username,
- "git_protocol": request.GitProtocol,
+ "command": "git-receive-pack",
+ "glProjectPath": request.Repository.GlProjectPath,
+ "glRepository": request.Repository.GlRepository,
+ "userId": response.UserId,
+ "userName": response.Username,
+ "gitProtocol": request.GitProtocol,
}
log.WithFields(fields).Info("executing git command")
diff --git a/internal/command/uploadarchive/gitalycall.go b/internal/command/uploadarchive/gitalycall.go
index 269a8e2..e07e6d1 100644
--- a/internal/command/uploadarchive/gitalycall.go
+++ b/internal/command/uploadarchive/gitalycall.go
@@ -5,6 +5,7 @@ import (
"google.golang.org/grpc"
+ log "github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/gitaly/client"
pb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
@@ -23,6 +24,16 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error {
request := &pb.SSHUploadArchiveRequest{Repository: &response.Gitaly.Repo}
+ fields := log.Fields{
+ "command": "git-upload-archive",
+ "glProjectPath": request.Repository.GlProjectPath,
+ "glRepository": request.Repository.GlRepository,
+ "userId": response.UserId,
+ "userName": response.Username,
+ }
+
+ log.WithFields(fields).Info("executing git command")
+
return gc.RunGitalyCommand(func(ctx context.Context, conn *grpc.ClientConn) (int32, error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
diff --git a/internal/command/uploadpack/gitalycall.go b/internal/command/uploadpack/gitalycall.go
index c55ce55..a9a05e4 100644
--- a/internal/command/uploadpack/gitalycall.go
+++ b/internal/command/uploadpack/gitalycall.go
@@ -30,12 +30,12 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error {
}
fields := log.Fields{
- "command": "git-upload-pack",
- "gl_project_path": request.Repository.GlProjectPath,
- "gl_repository": request.Repository.GlRepository,
- "user_id": response.UserId,
- "username": response.Username,
- "git_protocol": request.GitProtocol,
+ "command": "git-upload-pack",
+ "glProjectPath": request.Repository.GlProjectPath,
+ "glRepository": request.Repository.GlRepository,
+ "userId": response.UserId,
+ "userName": response.Username,
+ "gitProtocol": request.GitProtocol,
}
log.WithFields(fields).Info("executing git command")