Skip to content

Commit

Permalink
Adds the ability to get a repository by ID
Browse files Browse the repository at this point in the history
Fixes: hub4j#515
  • Loading branch information
jamesatha committed Apr 26, 2019
1 parent fad203a commit aa2b7ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/org/kohsuke/github/GitHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,14 @@ public GHRepository getRepository(String name) throws IOException {
String[] tokens = name.split("/");
return retrieve().to("/repos/" + tokens[0] + '/' + tokens[1], GHRepository.class).wrap(this);
}

/**
* Gets the repository object from its ID
*/
public GHRepository getRepositoryById(String id) throws IOException {
return retrieve().to("/repositories/" + id, GHRepository.class).wrap(this);
}

/**
* Returns a list of popular open source licenses
*
Expand Down

0 comments on commit aa2b7ae

Please sign in to comment.