Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add merge options to GHRepository #567

Merged
merged 7 commits into from
Oct 9, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public class GHRepository extends GHObject {
private String git_url, ssh_url, clone_url, svn_url, mirror_url;
private GHUser owner; // not fully populated. beware.
private boolean has_issues, has_wiki, fork, has_downloads, has_pages, archived;

private boolean allow_squash_merge;
private boolean allow_merge_commit;
private boolean allow_rebase_merge;

@JsonProperty("private")
private boolean _private;
private int forks_count, stargazers_count, watchers_count, size, open_issues_count, subscribers_count;
Expand Down Expand Up @@ -405,6 +410,18 @@ public boolean isFork() {
public boolean isArchived() {
return archived;
}

public boolean isAllowSquashMerge() {
return allow_squash_merge;
}

public boolean isAllowMergeCommit() {
return allow_merge_commit;
}

public boolean isAllowRebaseMerge() {
return allow_rebase_merge;
}

/**
* Returns the number of all forks of this repository.
Expand Down Expand Up @@ -631,7 +648,19 @@ public void setDefaultBranch(String value) throws IOException {
public void setPrivate(boolean value) throws IOException {
edit("private", Boolean.toString(value));
}


public void allowSquashMerge(boolean value) throws IOException {
edit("allow_squash_merge", Boolean.toString(value));
}

public void allowMergeCommit(boolean value) throws IOException {
edit("allow_merge_commit", Boolean.toString(value));
}

public void allowRebaseMerge(boolean value) throws IOException {
edit("allow_rebase_merge", Boolean.toString(value));
}

/**
* Deletes this repository.
*/
Expand Down