Skip to content

Commit

Permalink
fix: remove duplicate method() calls in GHContent class
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG authored Aug 18, 2023
1 parent 9c00184 commit 8493eda
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/org/kohsuke/github/GHContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,11 @@ public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessa
String encodedContent = Base64.getEncoder().encodeToString(newContentBytes);

Requester requester = root().createRequest()
.method("POST")
.method("PUT")
.with("path", path)
.with("message", commitMessage)
.with("sha", sha)
.with("content", encodedContent)
.method("PUT");
.with("content", encodedContent);

if (branch != null) {
requester.with("branch", branch);
Expand Down Expand Up @@ -368,11 +367,10 @@ public GHContentUpdateResponse delete(String message) throws IOException {
*/
public GHContentUpdateResponse delete(String commitMessage, String branch) throws IOException {
Requester requester = root().createRequest()
.method("POST")
.method("DELETE")
.with("path", path)
.with("message", commitMessage)
.with("sha", sha)
.method("DELETE");
.with("sha", sha);

if (branch != null) {
requester.with("branch", branch);
Expand Down

0 comments on commit 8493eda

Please sign in to comment.