Skip to content

Commit fb692b8

Browse files
committed
Added addComment(projectId, sha, note) (#67).
1 parent 92afc5f commit fb692b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/org/gitlab4j/api/CommitsApi.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,19 @@ public Comment addComment(int projectId, String sha, String note, String path, I
224224
Response response = post(Response.Status.CREATED, formData, "projects", projectId, "repository", "commits", sha, "comments");
225225
return (response.readEntity(Comment.class));
226226
}
227+
228+
/**
229+
* Add a comment to a commit.
230+
*
231+
* POST /projects/:id/repository/commits/:sha/comments
232+
*
233+
* @param projectId the project ID that the commit belongs to
234+
* @param sha a commit hash or name of a branch or tag
235+
* @param note the text of the comment, required
236+
* @return a Comment instance for the posted comment
237+
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
238+
*/
239+
public Comment addComment(int projectId, String sha, String note) throws GitLabApiException {
240+
return (addComment(projectId, sha, note, null, null, null));
241+
}
227242
}

0 commit comments

Comments
 (0)