Skip to content

Commit 5098db8

Browse files
authored
Fix api name for fetching diff in harness driver (#268)
* Fix api name for fetching diff in harness driver
1 parent 1579795 commit 5098db8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scm/driver/harness/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (s *gitService) ListChanges(ctx context.Context, repo, ref string, _ scm.Li
8080

8181
func (s *gitService) CompareChanges(ctx context.Context, repo, source, target string, _ scm.ListOptions) ([]*scm.Change, *scm.Response, error) {
8282
harnessURI := buildHarnessURI(s.client.account, s.client.organization, s.client.project, repo)
83-
path := fmt.Sprintf("api/v1/repos/%s/compare/%s...%s", harnessURI, source, target)
83+
path := fmt.Sprintf("api/v1/repos/%s/diff/%s...%s", harnessURI, source, target)
8484
buf := new(strings.Builder)
8585
res, err := s.client.do(ctx, "GET", path, nil, buf)
8686
return convertCompareChanges(buf.String()), res, err

scm/driver/harness/git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func TestCompareChanges(t *testing.T) {
215215
defer gock.Off()
216216

217217
gock.New(gockOrigin).
218-
Get(fmt.Sprintf("/gateway/code/api/v1/repos/px7xd_BFRCi-pfWPYXVjvw/default/codeciintegration/thomas/+/compare/%s...%s", source, target)).
218+
Get(fmt.Sprintf("/gateway/code/api/v1/repos/px7xd_BFRCi-pfWPYXVjvw/default/codeciintegration/thomas/+/diff/%s...%s", source, target)).
219219
Reply(200).
220220
Type("application/json").
221221
File("testdata/gitdiff.json")

0 commit comments

Comments
 (0)