Skip to content

Commit b0b83c9

Browse files
Lirickmarthast
andauthored
Fix the delete reference endpoint (#31)
Co-authored-by: marthast <marthast@spotify.com>
1 parent 55485ca commit b0b83c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/spotify/github/v3/clients/GitDataClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static GitDataClient create(final GitHubClient github, final String owner, final
6363
*/
6464
public CompletableFuture<Void> deleteReference(final String ref) {
6565
final String path =
66-
format(REFERENCE_URI, owner, repo, ref);
66+
format(REFERENCE_URI, owner, repo, ref.replaceAll("refs/", ""));
6767
return github.delete(path).thenAccept(IGNORE_RESPONSE_CONSUMER);
6868
}
6969

@@ -73,7 +73,7 @@ public CompletableFuture<Void> deleteReference(final String ref) {
7373
* @param branch search parameters
7474
*/
7575
public CompletableFuture<Void> deleteBranch(final String branch) {
76-
return deleteReference("refs/heads/" + branch.replaceAll("refs/heads/", ""));
76+
return deleteReference("heads/" + branch.replaceAll("refs/heads/", ""));
7777
}
7878

7979
/**
@@ -82,7 +82,7 @@ public CompletableFuture<Void> deleteBranch(final String branch) {
8282
* @param tag search parameters
8383
*/
8484
public CompletableFuture<Void> deleteTag(final String tag) {
85-
return deleteReference("refs/tags/" + tag.replaceAll("refs/tags/", ""));
85+
return deleteReference("tags/" + tag.replaceAll("refs/tags/", ""));
8686
}
8787

8888
/**

0 commit comments

Comments
 (0)