Skip to content

Commit

Permalink
Merge pull request #1697 from BoboTiG/fix-duplicate-method-calls-ghco…
Browse files Browse the repository at this point in the history
…ntent

fix: remove duplicate `method()` calls in GHContent class
  • Loading branch information
bitwiseman authored Aug 21, 2023
2 parents 9c00184 + 8493eda commit afb3477
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 afb3477

Please sign in to comment.