|
|
|
@ -216,8 +216,6 @@ type CommitsByFileAndRangeOptions struct {
|
|
|
|
|
|
|
|
|
|
|
|
// CommitsByFileAndRange return the commits according revision file and the page
|
|
|
|
// CommitsByFileAndRange return the commits according revision file and the page
|
|
|
|
func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions) ([]*Commit, error) {
|
|
|
|
func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions) ([]*Commit, error) {
|
|
|
|
skip := (opts.Page - 1) * setting.Git.CommitsRangeSize
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdoutReader, stdoutWriter := io.Pipe()
|
|
|
|
stdoutReader, stdoutWriter := io.Pipe()
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|
_ = stdoutReader.Close()
|
|
|
|
_ = stdoutReader.Close()
|
|
|
|
@ -226,8 +224,8 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
|
|
|
|
go func() {
|
|
|
|
go func() {
|
|
|
|
stderr := strings.Builder{}
|
|
|
|
stderr := strings.Builder{}
|
|
|
|
gitCmd := NewCommand(repo.Ctx, "rev-list").
|
|
|
|
gitCmd := NewCommand(repo.Ctx, "rev-list").
|
|
|
|
AddOptionFormat("--max-count=%d", setting.Git.CommitsRangeSize*opts.Page).
|
|
|
|
AddOptionFormat("--max-count=%d", setting.Git.CommitsRangeSize).
|
|
|
|
AddOptionFormat("--skip=%d", skip)
|
|
|
|
AddOptionFormat("--skip=%d", (opts.Page-1)*setting.Git.CommitsRangeSize)
|
|
|
|
gitCmd.AddDynamicArguments(opts.Revision)
|
|
|
|
gitCmd.AddDynamicArguments(opts.Revision)
|
|
|
|
|
|
|
|
|
|
|
|
if opts.Not != "" {
|
|
|
|
if opts.Not != "" {
|
|
|
|
|