// ListCommits returns a list of commits in a given revision range.
ListCommits returns a list of commits in a given revision range.
// ListCommits returns a list of commits in a given revision range .
func (r *repo) ListCommits(ctx context.Context, revisionRange string) ([]Commit, error) {
	args := []string{
		"log",
		"--no-decorate",
		fmt.Sprintf("--pretty=format:%s", commitLogFormat),
	}
	if revisionRange != "" {
		args = append(args, revisionRange)
	}
	out, err := r.runGitCommand(ctx, args...)
	if err != nil {
		return nil, formatCommandError(err, out)
	}
	return parseCommits(string(out))
}
func ( r * repo ) ListCommits ( ctx context . Context , revisionRange string ) ( [ ] Commit , error ) { args := [ ] string { " " , " " , fmt . Sprintf ( " " , commitLogFormat ) , } if revisionRange != " " { args = append ( args , revisionRange ) } out , err := r . runGitCommand ( ctx , args ... ) if err != nil { return nil , formatCommandError ( err , out ) } return parseCommits ( string ( out ) ) }
ListCommits returns a list of commits in a given revision range.
ListCommits returns a list of commits in a given revision range .