Skip to content

Commit aab121d

Browse files
author
chhsia0
committed
Marked PR creation unsupported in Gogs driver.
1 parent aaa0db2 commit aab121d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

scm/driver/gogs/pr.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func (s *pullService) ListChanges(context.Context, string, int, scm.ListOptions)
3434
return nil, nil, scm.ErrNotSupported
3535
}
3636

37+
func (s *pullService) Create(context.Context, string, *scm.PullRequestInput) (*scm.PullRequest, *scm.Response, error) {
38+
return nil, nil, scm.ErrNotSupported
39+
}
40+
3741
func (s *pullService) CreateComment(context.Context, string, int, *scm.CommentInput) (*scm.Comment, *scm.Response, error) {
3842
return nil, nil, scm.ErrNotSupported
3943
}

scm/driver/gogs/pr_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ func TestPullRequestList(t *testing.T) {
3131
}
3232
}
3333

34+
func TestPullRequestCreate(t *testing.T) {
35+
client, _ := New("https://try.gogs.io")
36+
_, _, err := client.PullRequests.Create(context.Background(), "gogits/gogs", &scm.PullRequestInput{})
37+
if err != scm.ErrNotSupported {
38+
t.Errorf("Expect Not Supported error")
39+
}
40+
}
41+
3442
func TestPullRequestClose(t *testing.T) {
3543
client, _ := New("https://try.gogs.io")
3644
_, err := client.PullRequests.Close(context.Background(), "gogits/gogs", 1)

0 commit comments

Comments
 (0)