Skip to content

Commit 8493eda

Browse files
authored
fix: remove duplicate method() calls in GHContent class
1 parent 9c00184 commit 8493eda

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main/java/org/kohsuke/github/GHContent.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,11 @@ public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessa
321321
String encodedContent = Base64.getEncoder().encodeToString(newContentBytes);
322322

323323
Requester requester = root().createRequest()
324-
.method("POST")
324+
.method("PUT")
325325
.with("path", path)
326326
.with("message", commitMessage)
327327
.with("sha", sha)
328-
.with("content", encodedContent)
329-
.method("PUT");
328+
.with("content", encodedContent);
330329

331330
if (branch != null) {
332331
requester.with("branch", branch);
@@ -368,11 +367,10 @@ public GHContentUpdateResponse delete(String message) throws IOException {
368367
*/
369368
public GHContentUpdateResponse delete(String commitMessage, String branch) throws IOException {
370369
Requester requester = root().createRequest()
371-
.method("POST")
370+
.method("DELETE")
372371
.with("path", path)
373372
.with("message", commitMessage)
374-
.with("sha", sha)
375-
.method("DELETE");
373+
.with("sha", sha);
376374

377375
if (branch != null) {
378376
requester.with("branch", branch);

0 commit comments

Comments
 (0)