Skip to content

Commit 1212ae3

Browse files
committed
Touch up for uniformity
- Prefer typed 'URL' over 'String' that is URL - Mark API as @Preview to communicate that this is subject to change More branch protection stuff needs to be added. See https://developer.github.com/v3/repos/branches/
1 parent 26c20a7 commit 1212ae3

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/main/java/org/kohsuke/github/GHBranch.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static org.kohsuke.github.Previews.LOKI;
44

55
import java.io.IOException;
6+
import java.net.URL;
67
import java.util.Arrays;
78
import java.util.Collection;
89

@@ -51,13 +52,21 @@ public GHRepository getOwner() {
5152
public String getName() {
5253
return name;
5354
}
54-
55+
56+
/**
57+
* Returns true if the push to this branch is restricted via branch protection.
58+
*/
59+
@Preview @Deprecated
5560
public boolean isProtected() {
56-
return protection;
61+
return protection;
5762
}
5863

59-
public String getProtection_url() {
60-
return protection_url;
64+
/**
65+
* Returns API URL that deals with the protection of this branch.
66+
*/
67+
@Preview @Deprecated
68+
public URL getProtectionUrl() {
69+
return GitHub.parseURL(protection_url);
6170
}
6271

6372

0 commit comments

Comments
 (0)