diff options
author | Matthew Walowski <mattwalowski@gmail.com> | 2023-05-08 00:10:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 07:10:53 +0000 |
commit | ff5629268c5c01d3f460570baa571baef3f896cd (patch) | |
tree | d0e85b7ca946b93bc7d74d30436aabcebb59dc27 /modules/context | |
parent | e962ade99cfd0471273f3dcf956c7cd222472758 (diff) | |
download | gitea-ff5629268c5c01d3f460570baa571baef3f896cd.tar.gz gitea-ff5629268c5c01d3f460570baa571baef3f896cd.zip |
Pass 'not' to commit count (#24473)
Due to #24409 , we can now specify '--not' when getting all commits from
a repo to exclude commits from a different branch.
When I wrote that PR, I forgot to also update the code that counts the
number of commits in the repo. So now, if the --not option is used, it
may return too many commits, which can indicate that another page of
data is available when it is not.
This PR passes --not to the commands that count the number of commits in
a repo
Diffstat (limited to 'modules/context')
-rw-r--r-- | modules/context/repo.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 6b811054c2..a1c8f43644 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -208,7 +208,12 @@ func (r *Repository) GetCommitGraphsCount(ctx context.Context, hidePRRefs bool, if len(branches) == 0 { return git.AllCommitsCount(ctx, r.Repository.RepoPath(), hidePRRefs, files...) } - return git.CommitsCountFiles(ctx, r.Repository.RepoPath(), branches, files) + return git.CommitsCount(ctx, + git.CommitsCountOptions{ + RepoPath: r.Repository.RepoPath(), + Revision: branches, + RelPath: files, + }) }) } |