From 1ce64dd21078f730b175ba52d73dbc08a53d52f8 Mon Sep 17 00:00:00 2001 From: Yshayy Date: Thu, 21 Jan 2021 06:32:03 +0000 Subject: [PATCH] replace "ref" paramater with "sha" --- scm/driver/github/git_test.go | 2 +- scm/driver/github/util.go | 2 +- scm/driver/github/util_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scm/driver/github/git_test.go b/scm/driver/github/git_test.go index 6e8a3707b..efa7e35e1 100644 --- a/scm/driver/github/git_test.go +++ b/scm/driver/github/git_test.go @@ -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). diff --git a/scm/driver/github/util.go b/scm/driver/github/util.go index a6b3c55a7..68dcaa635 100644 --- a/scm/driver/github/util.go +++ b/scm/driver/github/util.go @@ -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() } diff --git a/scm/driver/github/util_test.go b/scm/driver/github/util_test.go index c6a266433..cd5645b3b 100644 --- a/scm/driver/github/util_test.go +++ b/scm/driver/github/util_test.go @@ -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)