Skip to content

Commit

Permalink
Implement support for deleting a ref using the GitHub API.
Browse files Browse the repository at this point in the history
  • Loading branch information
farmdawgnation committed Aug 23, 2014
1 parent 077d693 commit 97a1c74
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@ public GHRef updateRef(String name, String sha, Boolean force) throws IOExceptio
.with("sha", sha).with("force", force).method("PATCH").to(getApiTailUrl("git/" + name), GHRef.class);
}

/**
* Deletes a particular ref from the repository using the GitHub API.
*
* @param name
* The name of the fully qualified reference (ie: refs/heads/master).
* If it doesn't start with 'refs' and have at least two slashes, it will be rejected.
*/
public void deleteRef(String name) throws IOException {
new Requester(root).method("DELETE").to(getApiTailUrl("git/" + name));
}

/**
* @deprecated
* use {@link #listReleases()}
Expand Down

0 comments on commit 97a1c74

Please sign in to comment.