alternative to PR "improve code quality" (#21464)

This PR doesn't require new git version, and can be backported easily.

Co-authored-by: 6543 <[email protected]>
This commit is contained in:
wxiaoguang
2022-10-15 12:49:26 +02:00
committed by GitHub
co-authored by GitHub 6543
parent 7917123209
commit d98c5db58f
6 changed files with 52 additions and 25 deletions
+1 -1
View File
@@ -166,7 +166,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...)