From f13ce6c9b793bb7022e88060edc0a070abde1756 Mon Sep 17 00:00:00 2001 From: Heidi Berry Date: Sat, 2 Nov 2024 20:52:21 +0000 Subject: [PATCH 1/2] Add Web URL to response when comparing in a repository --- repositories.go | 1 + repositories_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/repositories.go b/repositories.go index dde876174..73d300c75 100644 --- a/repositories.go +++ b/repositories.go @@ -209,6 +209,7 @@ type Compare struct { Diffs []*Diff `json:"diffs"` CompareTimeout bool `json:"compare_timeout"` CompareSameRef bool `json:"compare_same_ref"` + WebUrl string `json:"web_url"` } func (c Compare) String() string { diff --git a/repositories_test.go b/repositories_test.go index 4610bf3e8..2abe2a138 100644 --- a/repositories_test.go +++ b/repositories_test.go @@ -281,6 +281,7 @@ func TestRepositoriesService_Compare(t *testing.T) { }}, CompareTimeout: false, CompareSameRef: false, + WebUrl: "https://gitlab.example.com/thedude/gitlab-foss/-/compare/ae73cb07c9eeaf35924a10f713b364d32b2dd34f...0b4bc9a49b562e85de7cc9e834518ea6828729b9", } c, resp, err := client.Repositories.Compare("12d65c8dd2b2676fa3ac47d955accc085a37a9c1", opt, nil) From 4755022a3fdea03c4e6f6b557ee4a8a5750d4650 Mon Sep 17 00:00:00 2001 From: Heidi Berry Date: Sun, 3 Nov 2024 13:42:17 +0000 Subject: [PATCH 2/2] Use standard naming convention for initialisms --- repositories.go | 2 +- repositories_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/repositories.go b/repositories.go index 73d300c75..3c59f9abc 100644 --- a/repositories.go +++ b/repositories.go @@ -209,7 +209,7 @@ type Compare struct { Diffs []*Diff `json:"diffs"` CompareTimeout bool `json:"compare_timeout"` CompareSameRef bool `json:"compare_same_ref"` - WebUrl string `json:"web_url"` + WebURL string `json:"web_url"` } func (c Compare) String() string { diff --git a/repositories_test.go b/repositories_test.go index 2abe2a138..9130defcb 100644 --- a/repositories_test.go +++ b/repositories_test.go @@ -281,7 +281,7 @@ func TestRepositoriesService_Compare(t *testing.T) { }}, CompareTimeout: false, CompareSameRef: false, - WebUrl: "https://gitlab.example.com/thedude/gitlab-foss/-/compare/ae73cb07c9eeaf35924a10f713b364d32b2dd34f...0b4bc9a49b562e85de7cc9e834518ea6828729b9", + WebURL: "https://gitlab.example.com/thedude/gitlab-foss/-/compare/ae73cb07c9eeaf35924a10f713b364d32b2dd34f...0b4bc9a49b562e85de7cc9e834518ea6828729b9", } c, resp, err := client.Repositories.Compare("12d65c8dd2b2676fa3ac47d955accc085a37a9c1", opt, nil)