Merge pull request #325

This commit is contained in:
Kohsuke Kawaguchi
2017-01-09 16:06:14 -08:00

View File

@@ -1,13 +1,17 @@
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.net.URL;
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 +26,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;
@@ -45,6 +53,23 @@ public class GHBranch {
return name;
}
/**
* Returns true if the push to this branch is restricted via branch protection.
*/
@Preview @Deprecated
public boolean isProtected() {
return protection;
}
/**
* Returns API URL that deals with the protection of this branch.
*/
@Preview @Deprecated
public URL getProtectionUrl() {
return GitHub.parseURL(protection_url);
}
/**
* The commit that this branch currently points to.
*/