更改:使用gitcmd保证不会broken

This commit is contained in:
yystopf 2023-04-17 11:11:59 +08:00
parent f513d462e5
commit d70d74a2ae
1 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ func GetPaginateCodeAuthors(repo *gitea_git.Repository, fromTime time.Time, bran
var authors []*CodeActivityAuthor var authors []*CodeActivityAuthor
since := fromTime.Format(time.RFC3339) since := fromTime.Format(time.RFC3339)
authorCmd := gitea_git.NewCommand(repo.Ctx, "log", "--no-merges", "--format=%aN <%aE>", "--date=iso").AddDynamicArguments("--since='%s'", since) authorCmd := gitea_git.NewCommand(repo.Ctx, "log", "--no-merges", "--format=%aN <%aE>", "--date=iso", gitea_git.CmdArg(fmt.Sprintf("--since='%s'", since)))
if len(branch) == 0 { if len(branch) == 0 {
authorCmd.AddArguments("--branches=*") authorCmd.AddArguments("--branches=*")
} else { } else {
@ -201,7 +201,7 @@ func GetPaginateCodeAuthors(repo *gitea_git.Repository, fromTime time.Time, bran
_ = stdoutReader.Close() _ = stdoutReader.Close()
_ = stdoutWriter.Close() _ = stdoutWriter.Close()
}() }()
gitCmd := gitea_git.NewCommand(repo.Ctx, "log", "--numstat", "--no-merges", "--pretty=format:---%n%h%n%aN%n%aE%n", "--date=iso", gitea_git.CmdArg(fmt.Sprintf("--author=%s", filterAuthor))).AddDynamicArguments("--since='%s'", since) gitCmd := gitea_git.NewCommand(repo.Ctx, "log", "--numstat", "--no-merges", "--pretty=format:---%n%h%n%aN%n%aE%n", "--date=iso", gitea_git.CmdArg(fmt.Sprintf("--author=%s", filterAuthor)), gitea_git.CmdArg(fmt.Sprintf("--since='%s'", since)))
if len(branch) == 0 { if len(branch) == 0 {
gitCmd.AddArguments("--branches=*") gitCmd.AddArguments("--branches=*")
} else { } else {