1
0
Fork 0
forked from forgejo/forgejo

improve code quality (#21464) (#21463)

Backport #21464 and #21465

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
6543 2022-10-15 14:24:39 +02:00 committed by GitHub
parent 6afbef5a8b
commit cd48a007bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 27 deletions

View file

@ -163,7 +163,7 @@ func AllCommitsCount(ctx context.Context, repoPath string, hidePRRefs bool, file
// CommitsCountFiles returns number of total commits of until given revision.
func CommitsCountFiles(ctx context.Context, repoPath string, revision, relpath []string) (int64, error) {
cmd := NewCommand(ctx, "rev-list", "--count")
cmd.AddArguments(revision...)
cmd.AddDynamicArguments(revision...)
if len(relpath) > 0 {
cmd.AddArguments("--")
cmd.AddArguments(relpath...)