diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-06-14 12:15:49 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-06-14 12:32:33 +0300 |
commit | 56d5f28e85e75e91e8781910dba2974b1ac5272c (patch) | |
tree | ef3e48899bbc21a45e3d5d33952a103b6d0d6482 | |
parent | eef84a6ab29c2ca39a09d5df799434e3044aeb7f (diff) |
repository: Remove useless cast for setup of reftx hooks
The `git.WithRefTxHook()` nowadays only requires a `repository.GitRepo`
structure as input, but we still perform a cast to `gitalypb.Repository`
in `cloneFromPool()`. Drop this useless cast and pass in the repo
directly.
-rw-r--r-- | internal/gitaly/service/repository/clone_from_pool_internal.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/gitaly/service/repository/clone_from_pool_internal.go b/internal/gitaly/service/repository/clone_from_pool_internal.go index 894eaa2a3..96599a7bb 100644 --- a/internal/gitaly/service/repository/clone_from_pool_internal.go +++ b/internal/gitaly/service/repository/clone_from_pool_internal.go @@ -119,18 +119,13 @@ func (s *server) cloneFromPool(ctx context.Context, objectPoolRepo *gitalypb.Obj return fmt.Errorf("could not get object pool path: %v", err) } - pbRepo, ok := repo.(*gitalypb.Repository) - if !ok { - return fmt.Errorf("expected *gitlaypb.Repository but got %T", repo) - } - cmd, err := s.gitCmdFactory.NewWithoutRepo(ctx, git.SubCmd{ Name: "clone", Flags: []git.Option{git.Flag{Name: "--bare"}, git.Flag{Name: "--shared"}}, PostSepArgs: []string{objectPoolPath, repositoryPath}, }, - git.WithRefTxHook(ctx, pbRepo, s.cfg), + git.WithRefTxHook(ctx, repo, s.cfg), ) if err != nil { return fmt.Errorf("clone with object pool start: %v", err) |