google/go-github — pull request #60 by sqs (2013-10-03 05:02:17+00:00)
Title: Add RepositoriesService method GetByID for fetching a repository by its numeric ID

This PR adds a `GetByID(id int)` method to `RepositoriesService` that fetches a GitHub repository by its numeric ID from the undocumented `/repositories/:id` endpoint.

Being able to fetch a repository by its ID is useful for tracking it when its name changes. The API does not redirect from the old name to the new name (and even if it did, if you created a 2nd repo with the old name, the redirect would have to be removed). The numeric ID is also useful because it takes up less space than the (owner, name) tuple.

Users should use this method with caution :warning: because it uses an undocumented API endpoint. @willnorris, if you think it's a bad idea to merge this method in, I would understand.