Welcome to mirror list, hosted at ThFree Co, Russian Federation.

stats.go « commit « service « internal - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30605c80864bc9faa895e8c9029c903cee630db4 (plain)
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
package commit

import (
	"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
	"gitlab.com/gitlab-org/gitaly/internal/helper"
	"gitlab.com/gitlab-org/gitaly/internal/rubyserver"
	"golang.org/x/net/context"
)

func (s *server) CommitStats(ctx context.Context, in *gitalypb.CommitStatsRequest) (*gitalypb.CommitStatsResponse, error) {
	client, err := s.CommitServiceClient(ctx)
	if err != nil {
		return nil, err
	}

	repo := in.GetRepository()
	if _, err := helper.GetRepoPath(repo); err != nil {
		return nil, err
	}

	clientCtx, err := rubyserver.SetHeaders(ctx, repo)
	if err != nil {
		return nil, err
	}

	return client.CommitStats(clientCtx, in)
}