From df861f54033c23a976c28639a5e5fdf5d42b4c6e Mon Sep 17 00:00:00 2001 From: Timothy McNally Date: Tue, 9 Jan 2018 17:32:54 -0800 Subject: [PATCH] Adding methods to GHCreateRepositoryBuilder to allow setting the allowed merge methods for pull requests. --- .../github/GHCreateRepositoryBuilder.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java b/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java index 492aaf5c8..a11fc4493 100644 --- a/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java @@ -21,8 +21,8 @@ public class GHCreateRepositoryBuilder { } public GHCreateRepositoryBuilder description(String description) { - this.builder.with("description",description); - return this; + this.builder.with("description",description); + return this; } public GHCreateRepositoryBuilder homepage(URL homepage) { @@ -74,6 +74,30 @@ public class GHCreateRepositoryBuilder { return this; } + /** + * Allow or disallow squash-merging pull requests. + */ + public GHCreateRepositoryBuilder allowSquashMerge(boolean b) { + this.builder.with("allow_squash_merge",b); + return this; + } + + /** + * Allow or disallow merging pull requests with a merge commit. + */ + public GHCreateRepositoryBuilder allowMergeCommit(boolean b) { + this.builder.with("allow_merge_commit",b); + return this; + } + + /** + * Allow or disallow rebase-merging pull requests. + */ + public GHCreateRepositoryBuilder allowRebaseMerge(boolean b) { + this.builder.with("allow_rebase_merge",b); + return this; + } + /** * Creates a default .gitignore *