File tree Expand file tree Collapse file tree
src/main/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .kohsuke .github ;
22
3- import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
4- import org .kohsuke .github .BranchProtection .RequiredStatusChecks ;
3+ import static org .kohsuke .github .Previews .LOKI ;
54
65import java .io .IOException ;
6+ import java .net .URL ;
77import java .util .Arrays ;
88import java .util .Collection ;
99
10- import static org .kohsuke .github .Previews .LOKI ;
10+ import org .kohsuke .github .BranchProtection .RequiredStatusChecks ;
11+
12+ import com .fasterxml .jackson .annotation .JsonProperty ;
13+
14+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
1115
1216/**
1317 * A branch in a repository.
@@ -22,6 +26,10 @@ public class GHBranch {
2226
2327 private String name ;
2428 private Commit commit ;
29+ @ JsonProperty ("protected" )
30+ private boolean protection ;
31+ private String protection_url ;
32+
2533
2634 public static class Commit {
2735 String sha ;
@@ -45,6 +53,23 @@ public String getName() {
4553 return name ;
4654 }
4755
56+ /**
57+ * Returns true if the push to this branch is restricted via branch protection.
58+ */
59+ @ Preview @ Deprecated
60+ public boolean isProtected () {
61+ return protection ;
62+ }
63+
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 );
70+ }
71+
72+
4873 /**
4974 * The commit that this branch currently points to.
5075 */
You can’t perform that action at this time.
0 commit comments