Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 26c20a7

Browse filesBrowse files
Jeffrey.NelsonJeffrey.Nelson
authored andcommitted
add branch protection attributes
1 parent 9d15cd4 commit 26c20a7
Copy full SHA for 26c20a7

File tree

Expand file treeCollapse file tree

1 file changed

+19
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-3
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHBranch.java
+19-3Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package 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

65
import java.io.IOException;
76
import java.util.Arrays;
87
import java.util.Collection;
98

10-
import static org.kohsuke.github.Previews.LOKI;
9+
import org.kohsuke.github.BranchProtection.RequiredStatusChecks;
10+
11+
import com.fasterxml.jackson.annotation.JsonProperty;
12+
13+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
1114

1215
/**
1316
* A branch in a repository.
@@ -22,6 +25,10 @@ public class GHBranch {
2225

2326
private String name;
2427
private Commit commit;
28+
@JsonProperty("protected")
29+
private boolean protection;
30+
private String protection_url;
31+
2532

2633
public static class Commit {
2734
String sha;
@@ -44,6 +51,15 @@ public GHRepository getOwner() {
4451
public String getName() {
4552
return name;
4653
}
54+
55+
public boolean isProtected() {
56+
return protection;
57+
}
58+
59+
public String getProtection_url() {
60+
return protection_url;
61+
}
62+
4763

4864
/**
4965
* The commit that this branch currently points to.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.