diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-14 13:06:21 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-14 17:37:03 +0300 |
commit | 6f96258d0f2820e7ac2d7de2cc4dff32d7745a10 (patch) | |
tree | 525fda2770dcee1d97f0c854f78d09cc7287c8a9 | |
parent | f5c2ca788ea1448d0acb1f69b634fd1efab91a14 (diff) |
remote: Disable transactions for FetchInternalRemote
With the same reasoning as the preceding commit, this disables the
reference-transaction hook for `FetchInternalRemote`.
Note that the test change to create a single commit in the source
repository is sufficient to demonstrate that hooks aren't executed
anymore. Previously, there simply weren't any changes which were
fetched, which caused us to invoke no hooks at all. With this change, we
now create a commit and would thus update a reference in the target
repository, but as the test setup was incomplete and didn't set up the
hooks service at all, it would've failed to execute the hook now. But as
we now disabled hooks, it continues to succeed.
-rw-r--r-- | internal/gitaly/service/remote/fetch_internal_remote.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/remote/fetch_internal_remote_test.go | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/internal/gitaly/service/remote/fetch_internal_remote.go b/internal/gitaly/service/remote/fetch_internal_remote.go index ff644e64c..fae2a04f2 100644 --- a/internal/gitaly/service/remote/fetch_internal_remote.go +++ b/internal/gitaly/service/remote/fetch_internal_remote.go @@ -40,7 +40,7 @@ func (s *server) FetchInternalRemote(ctx context.Context, req *gitalypb.FetchInt Args: []string{gitalyssh.GitalyInternalURL, mirrorRefSpec}, }, git.WithStderr(stderr), - git.WithRefTxHook(ctx, req.Repository, config.Config), + git.WithDisabledHooks(), ) if err != nil { return nil, fmt.Errorf("create git fetch: %w", err) diff --git a/internal/gitaly/service/remote/fetch_internal_remote_test.go b/internal/gitaly/service/remote/fetch_internal_remote_test.go index 02af5a0f1..bd18b512f 100644 --- a/internal/gitaly/service/remote/fetch_internal_remote_test.go +++ b/internal/gitaly/service/remote/fetch_internal_remote_test.go @@ -62,6 +62,8 @@ func TestSuccessfulFetchInternalRemote(t *testing.T) { gitaly0Repo, gitaly0RepoPath, cleanup := cloneRepoAtStorage(t, repo, "gitaly-0") defer cleanup() + testhelper.CreateCommit(t, gitaly0RepoPath, "master", nil) + gitaly1Repo, gitaly1RepoPath, cleanup := cloneRepoAtStorage(t, repo, "gitaly-1") defer cleanup() |