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>2021-05-06 15:18:48 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-05-07 12:53:36 +0300
commit7e3e286bcc78108ae48b788ba12c2f1eb4a96f58 (patch)
tree730079e7233cc0c3244067614a1aec0e2f9626bd /internal/gitaly/service/repository/apply_gitattributes.go
parent2982990541d6980bf5035987996e976042c8ccc6 (diff)
voting: Move Vote and VoteHash types into shared package
The infrastructure for transactional voting is currently duplicated across Praefect and Gitaly. As a preparatory step to fix this and unify both, this commit moves Gitaly's `Vote` and `VoteHash` types into a new agnostic package "internal/transaction/voting". It would be more idiomatic to call the package "vote" instead of "voting", or to have the implementation in "internal/transaction". But the former is creating problems because one cannot name local variables "vote" anymore, while the latter causes problems because we now have import conflicts in a lot of places (e.g. "internal/gitaly/transaction" vs "internal/transaction"). As such, "voting" seems like the best compromise to avoid both issues.
Diffstat (limited to 'internal/gitaly/service/repository/apply_gitattributes.go')
-rw-r--r--internal/gitaly/service/repository/apply_gitattributes.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/gitaly/service/repository/apply_gitattributes.go b/internal/gitaly/service/repository/apply_gitattributes.go
index 7a876fb81..6d7586973 100644
--- a/internal/gitaly/service/repository/apply_gitattributes.go
+++ b/internal/gitaly/service/repository/apply_gitattributes.go
@@ -11,8 +11,8 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/catfile"
- "gitlab.com/gitlab-org/gitaly/internal/gitaly/transaction"
"gitlab.com/gitlab-org/gitaly/internal/praefect/metadata"
+ "gitlab.com/gitlab-org/gitaly/internal/transaction/voting"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -108,7 +108,7 @@ func (s *server) vote(ctx context.Context, oid git.ObjectID) error {
return fmt.Errorf("vote with invalid object ID: %w", err)
}
- vote, err := transaction.VoteFromHash(hash)
+ vote, err := voting.VoteFromHash(hash)
if err != nil {
return fmt.Errorf("cannot convert OID to vote: %w", err)
}