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-04-13 00:23:58 +0300
committerJustin Tobler <jtobler@gitlab.com>2023-04-24 21:18:00 +0300
commit6eb01771857b858adf93b1b9bfd53e149fed5054 (patch)
tree1bd11e8d6fd13f8b6a115feec8d909507406fa10 /internal/gitaly/transaction_manager.go
parenta563d4acd85abdb377ddb4aef3d2197fb78a17e9 (diff)
gitaly: Generalize repository ID generation
Currently `getRepositoryID()` requires a `repository` as an argument. In a future commit a repository ID will also need to be generated directly from a `repository.GitRepo`. Since `repository` already implements `repository.GitRepo` and `getRepositoryID` does not rely on anything additional, the argument type is change from `repository` to `repository.GitRepo`.
Diffstat (limited to 'internal/gitaly/transaction_manager.go')
-rw-r--r--internal/gitaly/transaction_manager.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/gitaly/transaction_manager.go b/internal/gitaly/transaction_manager.go
index a05d1a7a2..d847ef375 100644
--- a/internal/gitaly/transaction_manager.go
+++ b/internal/gitaly/transaction_manager.go
@@ -17,6 +17,7 @@ import (
"github.com/dgraph-io/badger/v3"
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo"
+ repo "gitlab.com/gitlab-org/gitaly/v15/internal/git/repository"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/updateref"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/hook"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/transaction"
@@ -904,7 +905,7 @@ func (mgr *TransactionManager) deleteKey(key []byte) error {
// getRepositoryID returns a repository's ID. The ID should never change as it is used in the database
// keys. Gitaly does not have a permanent ID to use yet so the repository's storage name and relative
// path are used as a composite key.
-func getRepositoryID(repository repository) string {
+func getRepositoryID(repository repo.GitRepo) string {
return repository.GetStorageName() + ":" + repository.GetRelativePath()
}