Skip to content

GitHub CommitListOptions Parameter is Out of Date #76

Open
@blueworrybear

Description

It seems to me that one of Git.ListCommits arguments CommitListOptions requires updating.
It uses ref to query commits from branch, but the GitHub official documentation (List Commits Parameters) says the query parameter should be sha

func encodeCommitListOptions(opts scm.CommitListOptions) string {
	params := url.Values{}
	if opts.Page != 0 {
		params.Set("page", strconv.Itoa(opts.Page))
	}
	if opts.Size != 0 {
		params.Set("per_page", strconv.Itoa(opts.Size))
	}
	if opts.Ref != "" {
		params.Set("ref", opts.Ref)
	}
	return params.Encode()
}

Using ref to query branch commits will always return commits from default (master) branch.
Please let me know if I am wrong. I could also create PR to update it if needed.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions