Skip to content

Commit

Permalink
Merge pull request #325
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Jan 10, 2017
2 parents 1266dcc + 1212ae3 commit 198fede
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -45,6 +53,23 @@ public String getName() {
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.
*/
Expand Down

0 comments on commit 198fede

Please sign in to comment.