Skip to content

Commit

Permalink
Fix api name for fetching diff in harness driver (#268)
Browse files Browse the repository at this point in the history
* Fix api name for fetching diff in harness driver
  • Loading branch information
shubham149 authored Aug 29, 2023
1 parent 1579795 commit 5098db8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scm/driver/harness/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (s *gitService) ListChanges(ctx context.Context, repo, ref string, _ scm.Li

func (s *gitService) CompareChanges(ctx context.Context, repo, source, target string, _ scm.ListOptions) ([]*scm.Change, *scm.Response, error) {
harnessURI := buildHarnessURI(s.client.account, s.client.organization, s.client.project, repo)
path := fmt.Sprintf("api/v1/repos/%s/compare/%s...%s", harnessURI, source, target)
path := fmt.Sprintf("api/v1/repos/%s/diff/%s...%s", harnessURI, source, target)
buf := new(strings.Builder)
res, err := s.client.do(ctx, "GET", path, nil, buf)
return convertCompareChanges(buf.String()), res, err
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/harness/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func TestCompareChanges(t *testing.T) {
defer gock.Off()

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

0 comments on commit 5098db8

Please sign in to comment.