diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2021-05-18 11:47:33 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2021-05-26 12:35:15 +0300 |
commit | a8341ef8d84a5352f1eb5d3ef6675b0a8275adac (patch) | |
tree | da7d3ce55e276edce16e1c081c41c5914b5e0964 | |
parent | 3d6ef137951e3e8971b1051ecc2a3cea04773e61 (diff) |
Unexport a constant only used in UpdateRemoteMirror
PushBatchSize constant is exported unnecessarily as it's only used
by UpdateRemoteMirror. This commit unexports it.
-rw-r--r-- | internal/gitaly/service/remote/update_remote_mirror.go | 8 | ||||
-rw-r--r-- | internal/gitaly/service/remote/update_remote_mirror_test.go | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/gitaly/service/remote/update_remote_mirror.go b/internal/gitaly/service/remote/update_remote_mirror.go index 05e5a782c..8cd12f908 100644 --- a/internal/gitaly/service/remote/update_remote_mirror.go +++ b/internal/gitaly/service/remote/update_remote_mirror.go @@ -15,8 +15,8 @@ import ( "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) -// PushBatchSize is the maximum number of branches to push in a single push call. -const PushBatchSize = 10 +// pushBatchSize is the maximum number of branches to push in a single push call. +const pushBatchSize = 10 func (s *server) UpdateRemoteMirror(stream gitalypb.RemoteService_UpdateRemoteMirrorServer) error { firstRequest, err := stream.Recv() @@ -221,8 +221,8 @@ func (s *server) goUpdateRemoteMirror(stream gitalypb.RemoteService_UpdateRemote for len(refspecs) > 0 { batch := refspecs - if len(refspecs) > PushBatchSize { - batch = refspecs[:PushBatchSize] + if len(refspecs) > pushBatchSize { + batch = refspecs[:pushBatchSize] } refspecs = refspecs[len(batch):] diff --git a/internal/gitaly/service/remote/update_remote_mirror_test.go b/internal/gitaly/service/remote/update_remote_mirror_test.go index 705ea747f..767b04031 100644 --- a/internal/gitaly/service/remote/update_remote_mirror_test.go +++ b/internal/gitaly/service/remote/update_remote_mirror_test.go @@ -352,7 +352,7 @@ func testUpdateRemoteMirrorFeatured(t *testing.T, ctx context.Context, cfg confi desc: "push batching works", sourceRefs: func() refs { out := refs{} - for i := 0; i < 2*PushBatchSize+1; i++ { + for i := 0; i < 2*pushBatchSize+1; i++ { out[fmt.Sprintf("refs/heads/branch-%d", i)] = []string{"commit 1"} } return out @@ -360,7 +360,7 @@ func testUpdateRemoteMirrorFeatured(t *testing.T, ctx context.Context, cfg confi response: &gitalypb.UpdateRemoteMirrorResponse{}, expectedMirrorRefs: func() map[string]string { out := map[string]string{} - for i := 0; i < 2*PushBatchSize+1; i++ { + for i := 0; i < 2*pushBatchSize+1; i++ { out[fmt.Sprintf("refs/heads/branch-%d", i)] = "commit 1" } return out |