Skip to content

Commit

Permalink
Repository deletion.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Apr 24, 2009
1 parent db88a97 commit c8c7a82
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ Consider this case where a private repository is created.
agh.repos.create('testrepo', description='My test repo',
homepage='http://www.spy.net/', public=0)

### Deleting a Repository

You may delete repositories attached to your account only.

agh.repos.delete('testrepo')

## Commits

The [commit API][commitapi] is available via `gh.commits`.
Expand Down
4 changes: 4 additions & 0 deletions src/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ def create(self, name, description='', homepage='', public=1):
self._post('repos/create', name=name, description=description,
homepage=homepage, public=str(public))

def delete(self, repo):
"""Delete a repository."""
self._post('repos/delete/' + repo)

class CommitEndpoint(BaseEndpoint):

def forBranch(self, user, repo, branch='master'):
Expand Down
5 changes: 5 additions & 0 deletions src/githubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ def testCreateRepository(self):
public='1').repos.create(
'testrepo', description='woo')

def testDeleteRepo(self):
"""Test setting a repo to private."""
self._ghp('repos/delete/mytest', 'dustin', 'p').repos.delete('mytest')


class CommitTest(BaseCase):

def testCommitList(self):
Expand Down

0 comments on commit c8c7a82

Please sign in to comment.