Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-27 08:52:37 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-27 13:50:26 +0300
commitfc5aad6d0224dd21165e73e7926e301e1890367b (patch)
treeb4ddb9e078dba6c35d38809cb5ebb135cfaf9ad9
parentac3ff5fca88c605bd1b097807679a04805d21ac2 (diff)
ssh: Simplify handling of `GlRepository()` for logging purposes
When receiving an SSHUploadPack request we log some information included in the request. Part of that information is the information about the GitLab repository the request has been created for, which we laboriously extract from the request while paying attention to not dereference any `nil` pointers. Simplify the code to insetad use the Protobuf's getter functions, which already know to handle `nil` pointers for us.
-rw-r--r--internal/gitaly/service/ssh/upload_pack.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/gitaly/service/ssh/upload_pack.go b/internal/gitaly/service/ssh/upload_pack.go
index 807735bbc..d17fafcf5 100644
--- a/internal/gitaly/service/ssh/upload_pack.go
+++ b/internal/gitaly/service/ssh/upload_pack.go
@@ -28,13 +28,8 @@ func (s *server) SSHUploadPack(stream gitalypb.SSHService_SSHUploadPackServer) e
return helper.ErrInternal(err)
}
- repository := ""
- if req.Repository != nil {
- repository = req.Repository.GlRepository
- }
-
ctxlogrus.Extract(ctx).WithFields(log.Fields{
- "GlRepository": repository,
+ "GlRepository": req.GetRepository().GetGlRepository(),
"GitConfigOptions": req.GitConfigOptions,
"GitProtocol": req.GitProtocol,
}).Debug("SSHUploadPack")