diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index a55ad588f4..4859eac77d 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1539,7 +1539,7 @@ public GHRepository createFork(@Nullable String organization, @Nullable String n name = name != null ? name : this.name; GHRepository r; try { - r = GHRepository.read(root(), root().getMyself().getLogin(), name); + r = GHRepository.read(root(), root().getMyself().getLogin(), name); } catch (FileNotFoundException e) { r = null; } @@ -1558,9 +1558,11 @@ public GHRepository createFork(@Nullable String organization, @Nullable String n /** * Creates a fork of this repository. * - * @param defaultBranchOnly if true, only the default branch will be forked + * @param defaultBranchOnly + * if true, only the default branch will be forked * @return the newly forked repository - * @throws IOException if an I/O error occurs + * @throws IOException + * if an I/O error occurs */ public GHRepository createFork(boolean defaultBranchOnly) throws IOException { return createFork(null, null, defaultBranchOnly); @@ -1570,7 +1572,8 @@ public GHRepository createFork(boolean defaultBranchOnly) throws IOException { * Creates a fork of this repository with the default branch only. * * @return the newly forked repository - * @throws IOException if an I/O error occurs + * @throws IOException + * if an I/O error occurs */ public GHRepository createFork() throws IOException { return createFork(true); diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 5f54ee27e6..bc63b74e36 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -834,7 +834,8 @@ public void testCreateForkWithValidParameters() throws IOException { String repositoryName = "rubywm"; String upstreamRepositoryOrganization = "kohsuke"; cleanupRepository(GITHUB_API_TEST_ORG + "/" + repositoryName); - GHRepository forkedRepository = gitHub.getRepository(upstreamRepositoryOrganization + "/" + repositoryName).createFork(gitHub.getOrganization(GITHUB_API_TEST_ORG).name, repositoryName, true); + GHRepository forkedRepository = gitHub.getRepository(upstreamRepositoryOrganization + "/" + repositoryName) + .createFork(gitHub.getOrganization(GITHUB_API_TEST_ORG).name, repositoryName, true); assertThat(forkedRepository, notNullValue()); assertThat(forkedRepository.getOwnerName(), equalTo("new-owner")); assertThat(forkedRepository.getName(), equalTo("new-repo"));