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 943f47d

Browse filesBrowse files
onoguera-obsbabu-salesforce
authored andcommitted
1 parent d61697a commit 943f47d
Copy full SHA for 943f47d

File tree

Expand file treeCollapse file tree

1 file changed

+9
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-7
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,27 +1394,29 @@ public GHContent getReadme() throws IOException {
13941394
return requester.to(getApiTailUrl("readme"), GHContent.class).wrap(this);
13951395
}
13961396

1397-
public GHContentUpdateResponse createContent(String content, String commitMessage, String path) throws IOException {
1398-
return createContent(content, commitMessage, path, null);
1397+
public GHContentUpdateResponse createContent(String content, String commitMessage, String path,String sha1) throws IOException {
1398+
return createContent(content, commitMessage, path, null,sha1);
13991399
}
14001400

1401-
public GHContentUpdateResponse createContent(String content, String commitMessage, String path, String branch) throws IOException {
1401+
public GHContentUpdateResponse createContent(String content, String commitMessage, String path, String branch, String sha1) throws IOException {
14021402
final byte[] payload;
14031403
try {
14041404
payload = content.getBytes("UTF-8");
14051405
} catch (UnsupportedEncodingException ex) {
14061406
throw (IOException) new IOException("UTF-8 encoding is not supported").initCause(ex);
14071407
}
1408-
return createContent(payload, commitMessage, path, branch);
1408+
return createContent(payload, commitMessage, path, branch,sha1);
14091409
}
14101410

1411-
public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path) throws IOException {
1412-
return createContent(contentBytes, commitMessage, path, null);
1411+
public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path,String sha1) throws IOException {
1412+
return createContent(contentBytes, commitMessage, path, null,sha1);
14131413
}
14141414

1415-
public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path, String branch) throws IOException {
1415+
public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path, String branch,
1416+
String sha1) throws IOException {
14161417
Requester requester = new Requester(root)
14171418
.with("path", path)
1419+
.with("sha", sha1)
14181420
.with("message", commitMessage)
14191421
.with("content", Base64.encodeBase64String(contentBytes))
14201422
.method("PUT");

0 commit comments

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