diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index 4c80db9ef4..9870732d0d 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -1,13 +1,16 @@ package org.kohsuke.github; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import org.kohsuke.github.BranchProtection.RequiredStatusChecks; +import static org.kohsuke.github.Previews.LOKI; import java.io.IOException; import java.util.Arrays; import java.util.Collection; -import static org.kohsuke.github.Previews.LOKI; +import org.kohsuke.github.BranchProtection.RequiredStatusChecks; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * A branch in a repository. @@ -22,6 +25,10 @@ public class GHBranch { private String name; private Commit commit; + @JsonProperty("protected") + private boolean protection; + private String protection_url; + public static class Commit { String sha; @@ -44,6 +51,15 @@ public GHRepository getOwner() { public String getName() { return name; } + + public boolean isProtected() { + return protection; + } + + public String getProtection_url() { + return protection_url; + } + /** * The commit that this branch currently points to.