|
|
@ -161,7 +161,7 @@ func (repo *Repository) searchCommits(id SHA1, opts SearchCommitsOptions) ([]*Co |
|
|
|
// add previous arguments except for --grep and --all
|
|
|
|
// add previous arguments except for --grep and --all
|
|
|
|
hashCmd.AddArguments(args...) |
|
|
|
hashCmd.AddArguments(args...) |
|
|
|
// add keyword as <commit>
|
|
|
|
// add keyword as <commit>
|
|
|
|
hashCmd.AddArguments(v) |
|
|
|
hashCmd.AddDynamicArguments(v) |
|
|
|
|
|
|
|
|
|
|
|
// search with given constraints for commit matching sha hash of v
|
|
|
|
// search with given constraints for commit matching sha hash of v
|
|
|
|
hashMatching, _, err := hashCmd.RunStdBytes(&RunOpts{Dir: repo.Path}) |
|
|
|
hashMatching, _, err := hashCmd.RunStdBytes(&RunOpts{Dir: repo.Path}) |
|
|
@ -211,14 +211,17 @@ func (repo *Repository) CommitsByFileAndRange(revision, file string, page int) ( |
|
|
|
}() |
|
|
|
}() |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
stderr := strings.Builder{} |
|
|
|
stderr := strings.Builder{} |
|
|
|
err := NewCommand(repo.Ctx, "rev-list", revision, |
|
|
|
gitCmd := NewCommand(repo.Ctx, "rev-list", |
|
|
|
"--max-count="+strconv.Itoa(setting.Git.CommitsRangeSize*page), |
|
|
|
"--max-count="+strconv.Itoa(setting.Git.CommitsRangeSize*page), |
|
|
|
"--skip="+strconv.Itoa(skip), "--", file). |
|
|
|
"--skip="+strconv.Itoa(skip), |
|
|
|
Run(&RunOpts{ |
|
|
|
) |
|
|
|
Dir: repo.Path, |
|
|
|
gitCmd.AddDynamicArguments(revision) |
|
|
|
Stdout: stdoutWriter, |
|
|
|
gitCmd.AddArguments("--", file) |
|
|
|
Stderr: &stderr, |
|
|
|
err := gitCmd.Run(&RunOpts{ |
|
|
|
}) |
|
|
|
Dir: repo.Path, |
|
|
|
|
|
|
|
Stdout: stdoutWriter, |
|
|
|
|
|
|
|
Stderr: &stderr, |
|
|
|
|
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
_ = stdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String())) |
|
|
|
_ = stdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String())) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|