diff --git a/github2/repositories.py b/github2/repositories.py index 5486e31..362a32d 100644 --- a/github2/repositories.py +++ b/github2/repositories.py @@ -91,3 +91,10 @@ class Repositories(GithubCommand): def branches(self, project): return self.make_request("show", project, "branches", filter="branches") + + def watching(self, for_user=None): + """Lists all the repos a user is watching.""" + for_user = for_user or self.request.username + return self.get_values("watched", for_user, filter="repositories", + datatype=Repository) +