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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-09-22 14:31:40 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-09-22 14:31:40 +0300
commit7a83a725f81b27fc4ed553ccefb44635b560945c (patch)
tree17570327ab0a3a20cb1279d4a281c3f0c5d88dfb
parent7ca5e752a73f8868d05e3be43922b20e210d0462 (diff)
hook: Make function to vote on transactions private
With commit 77608866 (hooks: Remove prereceive hook Ruby implementation, 2020-09-03) the code path for the Ruby-based pre-receive hook has been removed. This removed the last callsite of `VoteOnTransaction` outside of `internal/gitaly/hook`. And as other packages should have no business in voting on transactions via hooks, we can now make the function private.
-rw-r--r--internal/gitaly/hook/referencetransaction.go2
-rw-r--r--internal/gitaly/hook/transactions.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/gitaly/hook/referencetransaction.go b/internal/gitaly/hook/referencetransaction.go
index 8564c59dd..d16cce80a 100644
--- a/internal/gitaly/hook/referencetransaction.go
+++ b/internal/gitaly/hook/referencetransaction.go
@@ -16,7 +16,7 @@ func (m *GitLabHookManager) ReferenceTransactionHook(ctx context.Context, env []
}
hash := sha1.Sum(changes)
- if err := m.VoteOnTransaction(ctx, hash[:], env); err != nil {
+ if err := m.voteOnTransaction(ctx, hash[:], env); err != nil {
return helper.ErrInternalf("error voting on transaction: %v", err)
}
diff --git a/internal/gitaly/hook/transactions.go b/internal/gitaly/hook/transactions.go
index dd979c3c6..0b1a78f1d 100644
--- a/internal/gitaly/hook/transactions.go
+++ b/internal/gitaly/hook/transactions.go
@@ -34,7 +34,7 @@ func (m *GitLabHookManager) getPraefectConn(ctx context.Context, server *metadat
return m.conns.Dial(ctx, address, server.Token)
}
-func (m *GitLabHookManager) VoteOnTransaction(ctx context.Context, hash []byte, env []string) error {
+func (m *GitLabHookManager) voteOnTransaction(ctx context.Context, hash []byte, env []string) error {
tx, err := metadata.TransactionFromEnv(env)
if err != nil {
if errors.Is(err, metadata.ErrTransactionNotFound) {