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:
authorJustin Tobler <jtobler@gitlab.com>2023-07-24 18:40:09 +0300
committerJustin Tobler <jtobler@gitlab.com>2023-07-24 18:49:39 +0300
commite1491ed50f1864b06d2c89acf5b587aa3f2a1591 (patch)
treed67eed8608960e50efb6ddb2d464d5eb9b9695a0
parent1e9e86bf376d44ed59109eca7a3b07c7161a370e (diff)
repository: Pass source and target repository to `createFromSnapshot`
Update the `createFromSnapshot` function signature to explicitly contain the source and target repository in order to streamline its reuse in a future commit.
-rw-r--r--internal/gitaly/service/repository/replicate.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/gitaly/service/repository/replicate.go b/internal/gitaly/service/repository/replicate.go
index 309435586..6b16c82fb 100644
--- a/internal/gitaly/service/repository/replicate.go
+++ b/internal/gitaly/service/repository/replicate.go
@@ -154,16 +154,16 @@ func (s *server) create(ctx context.Context, in *gitalypb.ReplicateRepositoryReq
ctxlogrus.Extract(ctx).WithField("repo_path", repoPath).Warn("removed invalid repository")
}
- if err := s.createFromSnapshot(ctx, in); err != nil {
+ if err := s.createFromSnapshot(ctx, in.GetSource(), in.GetRepository()); err != nil {
return fmt.Errorf("could not create repository from snapshot: %w", err)
}
return nil
}
-func (s *server) createFromSnapshot(ctx context.Context, in *gitalypb.ReplicateRepositoryRequest) error {
- if err := repoutil.Create(ctx, s.locator, s.gitCmdFactory, s.txManager, in.GetRepository(), func(repo *gitalypb.Repository) error {
- if err := s.extractSnapshot(ctx, in.GetSource(), repo); err != nil {
+func (s *server) createFromSnapshot(ctx context.Context, source, target *gitalypb.Repository) error {
+ if err := repoutil.Create(ctx, s.locator, s.gitCmdFactory, s.txManager, target, func(repo *gitalypb.Repository) error {
+ if err := s.extractSnapshot(ctx, source, repo); err != nil {
return fmt.Errorf("extracting snapshot: %w", err)
}