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
33
34
|
package repository
import (
"context"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/internal/helper"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// Deprecated
func (s *server) Exists(ctx context.Context, in *gitalypb.RepositoryExistsRequest) (*gitalypb.RepositoryExistsResponse, error) {
return nil, status.Error(codes.Unimplemented, "this rpc is not implemented")
}
func (s *server) RepositoryExists(ctx context.Context, in *gitalypb.RepositoryExistsRequest) (*gitalypb.RepositoryExistsResponse, error) {
path, err := s.locator.GetPath(in.Repository)
if err != nil {
return nil, err
}
return &gitalypb.RepositoryExistsResponse{Exists: storage.IsGitDirectory(path)}, nil
}
func (s *server) HasLocalBranches(ctx context.Context, in *gitalypb.HasLocalBranchesRequest) (*gitalypb.HasLocalBranchesResponse, error) {
hasBranches, err := s.localrepo(in.GetRepository()).HasBranches(ctx)
if err != nil {
return nil, helper.ErrInternal(err)
}
return &gitalypb.HasLocalBranchesResponse{Value: hasBranches}, nil
}
|