Skip to content

Commit dccb43f

Browse files
authored
Merge pull request hub4j#517 from jamesatha/repo-by-id
Adds the ability to get a repository by ID
2 parents afce9ec + aa2b7ae commit dccb43f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/java/org/kohsuke/github/GitHub.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,14 @@ public GHRepository getRepository(String name) throws IOException {
473473
String[] tokens = name.split("/");
474474
return retrieve().to("/repos/" + tokens[0] + '/' + tokens[1], GHRepository.class).wrap(this);
475475
}
476+
477+
/**
478+
* Gets the repository object from its ID
479+
*/
480+
public GHRepository getRepositoryById(String id) throws IOException {
481+
return retrieve().to("/repositories/" + id, GHRepository.class).wrap(this);
482+
}
483+
476484
/**
477485
* Returns a list of popular open source licenses
478486
*

0 commit comments

Comments
 (0)