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:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2018-07-17 11:46:03 +0300
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2018-07-17 11:46:03 +0300
commita9878490bd5e6a356c8644c93e8b781a8c683612 (patch)
treed1694996a2c958cde4f8a5ae62f7b97ea8f96cb9
parentb58e3ccbb3ef7a92c817004b30c4a72e3a1dca29 (diff)
parent41eb9dc17d351b2ee3eaf602dee15819114fd35b (diff)
Merge branch 'fix-path-logging' into 'master'
Fix diff path logging Closes #243 See merge request gitlab-org/gitaly!812
-rw-r--r--changelogs/unreleased/fix-path-logging.yml5
-rw-r--r--internal/service/diff/commit.go12
2 files changed, 15 insertions, 2 deletions
diff --git a/changelogs/unreleased/fix-path-logging.yml b/changelogs/unreleased/fix-path-logging.yml
new file mode 100644
index 000000000..94821ba17
--- /dev/null
+++ b/changelogs/unreleased/fix-path-logging.yml
@@ -0,0 +1,5 @@
+---
+title: Fix diff path logging
+merge_request: 812
+author:
+type: other
diff --git a/internal/service/diff/commit.go b/internal/service/diff/commit.go
index 94a310d37..fb1c1997b 100644
--- a/internal/service/diff/commit.go
+++ b/internal/service/diff/commit.go
@@ -23,7 +23,7 @@ func (s *server) CommitDiff(in *pb.CommitDiffRequest, stream pb.DiffService_Comm
"LeftCommitId": in.LeftCommitId,
"RightCommitId": in.RightCommitId,
"IgnoreWhitespaceChange": in.IgnoreWhitespaceChange,
- "Paths": in.Paths,
+ "Paths": logPaths(in.Paths),
}).Debug("CommitDiff")
if err := validateRequest(in); err != nil {
@@ -116,7 +116,7 @@ func (s *server) CommitDelta(in *pb.CommitDeltaRequest, stream pb.DiffService_Co
grpc_logrus.Extract(stream.Context()).WithFields(log.Fields{
"LeftCommitId": in.LeftCommitId,
"RightCommitId": in.RightCommitId,
- "Paths": in.Paths,
+ "Paths": logPaths(in.Paths),
}).Debug("CommitDelta")
if err := validateRequest(in); err != nil {
@@ -236,3 +236,11 @@ func deltaSize(diff *diff.Diff) int {
return size
}
+
+func logPaths(paths [][]byte) []string {
+ result := make([]string, len(paths))
+ for i, p := range paths {
+ result[i] = string(p)
+ }
+ return result
+}