Fixed the getReadme() method.

It was calling the wrong endpoint.
Fixed issue #99.
This commit is contained in:
Kohsuke Kawaguchi
2015-02-15 06:31:22 -08:00
parent 18696fca2d
commit 1dbcc4b776
3 changed files with 14 additions and 2 deletions

View File

@@ -964,8 +964,12 @@ public class GHRepository extends GHObject {
return Arrays.asList(files);
}
public GHContent getReadme() throws Exception {
return getFileContent("readme");
/**
* https://developer.github.com/v3/repos/contents/#get-the-readme
*/
public GHContent getReadme() throws IOException {
Requester requester = root.retrieve();
return requester.to(getApiTailUrl("readme"), GHContent.class).wrap(this);
}
public GHContentUpdateResponse createContent(String content, String commitMessage, String path) throws IOException {