blob: a0a474e9fc1f921c9864080179b44a79fa072025 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package commit
import (
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/log"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func (s *server) FindCommit(ctx context.Context, in *gitalypb.FindCommitRequest) (*gitalypb.FindCommitResponse, error) {
revision := in.GetRevision()
if err := git.ValidateRevision(revision); err != nil {
return nil, status.Errorf(codes.InvalidArgument, "FindCommit: revision: %v", err)
}
repo := in.GetRepository()
commit, err := log.GetCommit(ctx, repo, string(revision))
return &gitalypb.FindCommitResponse{Commit: commit}, err
}
|