@@ -1394,27 +1394,29 @@ public GHContent getReadme() throws IOException {
1394
1394
return requester .to (getApiTailUrl ("readme" ), GHContent .class ).wrap (this );
1395
1395
}
1396
1396
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 );
1399
1399
}
1400
1400
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 {
1402
1402
final byte [] payload ;
1403
1403
try {
1404
1404
payload = content .getBytes ("UTF-8" );
1405
1405
} catch (UnsupportedEncodingException ex ) {
1406
1406
throw (IOException ) new IOException ("UTF-8 encoding is not supported" ).initCause (ex );
1407
1407
}
1408
- return createContent (payload , commitMessage , path , branch );
1408
+ return createContent (payload , commitMessage , path , branch , sha1 );
1409
1409
}
1410
1410
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 );
1413
1413
}
1414
1414
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 {
1416
1417
Requester requester = new Requester (root )
1417
1418
.with ("path" , path )
1419
+ .with ("sha" , sha1 )
1418
1420
.with ("message" , commitMessage )
1419
1421
.with ("content" , Base64 .encodeBase64String (contentBytes ))
1420
1422
.method ("PUT" );
0 commit comments