Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9f3c5b9

Browse filesBrowse files
Store encoded content in class level variable on update.
1 parent a56357f commit 9f3c5b9
Copy full SHA for 9f3c5b9

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHContent.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ public GHContentUpdateResponse update(String newContent, String commitMessage) t
110110
}
111111

112112
public GHContentUpdateResponse update(String newContent, String commitMessage, String branch) throws IOException {
113+
String encodedContent = DatatypeConverter.printBase64Binary(newContent.getBytes());
114+
113115
Requester requester = new Requester(owner.root)
114116
.with("path", path)
115117
.with("message", commitMessage)
116118
.with("sha", sha)
117-
.with("content", DatatypeConverter.printBase64Binary(newContent.getBytes()))
119+
.with("content", encodedContent)
118120
.method("PUT");
119121

120122
if (branch != null) {
@@ -126,7 +128,7 @@ public GHContentUpdateResponse update(String newContent, String commitMessage, S
126128
response.getContent().wrap(owner);
127129
response.getCommit().wrapUp(owner);
128130

129-
this.content = newContent;
131+
this.content = encodedContent;
130132
return response;
131133
}
132134

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.