From e4de09c55b516c41b2c7e596f23e23c4bf36a8ab Mon Sep 17 00:00:00 2001 From: Rob Schoening Date: Sat, 9 May 2015 01:05:04 -0700 Subject: [PATCH 1/2] allow default branch to be set --- src/main/java/org/kohsuke/github/GHRepository.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index e4459e84d6..5a7550ea2c 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -494,6 +494,12 @@ public void setHomepage(String value) throws IOException { edit("homepage",value); } + public void setMasterBranch(String value) throws IOException { + // This method might be more aptly named setDefaultBranch, + // but we'll use setMasterBranch for consistency with the existing getMasterBranch. + edit("default_branch", value); + } + /** * Deletes this repository. */ From eb9551d81b896262945769ca469a7ecba482834e Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 17 Jul 2015 13:42:20 +0300 Subject: [PATCH 2/2] Renamed getMasterBranch to getDefaultBranch The new set method can be simply renamed without the backward compatibility version since it's new --- src/main/java/org/kohsuke/github/GHRepository.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 5a7550ea2c..f898440220 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -364,6 +364,14 @@ public Date getPushedAt() { * @return * This field is null until the user explicitly configures the master branch. */ + public String getDefaultBranch() { + return default_branch; + } + + /** + * @deprecated + * Renamed to {@link #getDefaultBranch()} + */ public String getMasterBranch() { return default_branch; } @@ -494,9 +502,7 @@ public void setHomepage(String value) throws IOException { edit("homepage",value); } - public void setMasterBranch(String value) throws IOException { - // This method might be more aptly named setDefaultBranch, - // but we'll use setMasterBranch for consistency with the existing getMasterBranch. + public void setDefaultBranch(String value) throws IOException { edit("default_branch", value); }