Move some functions to gitrepo package (#35503)
This commit is contained in:
@@ -210,7 +210,7 @@ func ToCommit(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Rep
|
||||
|
||||
// Get diff stats for commit
|
||||
if opts.Stat {
|
||||
diffShortStat, err := gitdiff.GetDiffShortStat(gitRepo, "", commit.ID.String())
|
||||
diffShortStat, err := gitdiff.GetDiffShortStat(ctx, repo, gitRepo, "", commit.ID.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u
|
||||
// Calculate diff
|
||||
startCommitID = pr.MergeBase
|
||||
|
||||
diffShortStats, err := gitdiff.GetDiffShortStat(gitRepo, startCommitID, endCommitID)
|
||||
diffShortStats, err := gitdiff.GetDiffShortStat(ctx, pr.BaseRepo, gitRepo, startCommitID, endCommitID)
|
||||
if err != nil {
|
||||
log.Error("GetDiffShortStat: %v", err)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user