diff options
author | Justin Tobler <jtobler@gitlab.com> | 2023-05-15 22:35:35 +0300 |
---|---|---|
committer | Justin Tobler <jtobler@gitlab.com> | 2023-05-22 20:27:51 +0300 |
commit | 0f2ebca3dee23ef403c81a9028e83fde6f2b3a34 (patch) | |
tree | 9e2dd5f84629d6f831efdbd810d410e475676ece | |
parent | 71ae6e6e7711d1886ac62f63f0c48dec26dc1606 (diff) |
repository: Rename `syncRepository()` function
The `syncRepository()` function name is misleading. The
`replicateRepository()` is really what is synchronizing the repository.
This change renames this function to `syncReferences()` in order to
improve clarity.
-rw-r--r-- | internal/gitaly/service/repository/replicate.go | 6 | ||||
-rw-r--r-- | internal/gitaly/service/repository/replicate_test.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/gitaly/service/repository/replicate.go b/internal/gitaly/service/repository/replicate.go index 0b6783306..b30fbfbff 100644 --- a/internal/gitaly/service/repository/replicate.go +++ b/internal/gitaly/service/repository/replicate.go @@ -93,8 +93,8 @@ func (s *server) replicateRepository(ctx context.Context, source, target *gitaly return fmt.Errorf("synchronizing gitattributes: %w", err) } - if err := s.syncRepository(ctx, source, target); err != nil { - return fmt.Errorf("synchronizing repository: %w", err) + if err := s.syncReferences(ctx, source, target); err != nil { + return fmt.Errorf("synchronizing references: %w", err) } if err := s.syncCustomHooks(ctx, source, target); err != nil { @@ -211,7 +211,7 @@ func (s *server) extractSnapshot(ctx context.Context, source, target *gitalypb.R return nil } -func (s *server) syncRepository(ctx context.Context, source, target *gitalypb.Repository) error { +func (s *server) syncReferences(ctx context.Context, source, target *gitalypb.Repository) error { repo := s.localrepo(target) if err := fetchInternalRemote(ctx, s.txManager, s.conns, repo, source); err != nil { diff --git a/internal/gitaly/service/repository/replicate_test.go b/internal/gitaly/service/repository/replicate_test.go index ea4793ecb..da9ea00b8 100644 --- a/internal/gitaly/service/repository/replicate_test.go +++ b/internal/gitaly/service/repository/replicate_test.go @@ -334,7 +334,7 @@ func TestReplicateRepository(t *testing.T) { return setupData{ source: source, target: target, - expectedError: structerr.NewInternal("replicating repository: synchronizing repository: fetch internal remote: exit status 128"), + expectedError: structerr.NewInternal("replicating repository: synchronizing references: fetch internal remote: exit status 128"), } }, }, |