Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scm/driver/github/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestGitListCommits(t *testing.T) {
Get("/repos/octocat/hello-world/commits").
MatchParam("page", "1").
MatchParam("per_page", "30").
MatchParam("ref", "master").
MatchParam("sha", "master").
Reply(200).
Type("application/json").
SetHeaders(mockHeaders).
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/github/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func encodeCommitListOptions(opts scm.CommitListOptions) string {
params.Set("per_page", strconv.Itoa(opts.Size))
}
if opts.Ref != "" {
params.Set("ref", opts.Ref)
params.Set("sha", opts.Ref)
}
return params.Encode()
}
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/github/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Test_encodeCommitListOptions(t *testing.T) {
Size: 30,
Ref: "master",
}
want := "page=10&per_page=30&ref=master"
want := "page=10&per_page=30&sha=master"
got := encodeCommitListOptions(opts)
if got != want {
t.Errorf("Want encoded commit list options %q, got %q", want, got)
Expand Down