1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package objectpool
import (
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/catfile"
"gitlab.com/gitlab-org/gitaly/internal/git/housekeeping"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/transaction"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
)
// FromProto returns an object pool object from a git repository object
func FromProto(
locator storage.Locator,
gitCmdFactory git.CommandFactory,
catfileCache catfile.Cache,
txManager transaction.Manager,
housekeepingManager housekeeping.Manager,
o *gitalypb.ObjectPool,
) (*ObjectPool, error) {
return NewObjectPool(locator, gitCmdFactory, catfileCache, txManager, housekeepingManager, o.GetRepository().GetStorageName(), o.GetRepository().GetRelativePath())
}
// ToProto returns a new struct that is the protobuf definition of the ObjectPool
func (o *ObjectPool) ToProto() *gitalypb.ObjectPool {
return &gitalypb.ObjectPool{
Repository: &gitalypb.Repository{
StorageName: o.GetStorageName(),
RelativePath: o.GetRelativePath(),
},
}
}
|