diff --git a/plugins/git4idea/tests/git4idea/branch/GitBranchWorkerTest.groovy b/plugins/git4idea/tests/git4idea/branch/GitBranchWorkerTest.groovy index 4d87e83dc6eb..82d167eac800 100644 --- a/plugins/git4idea/tests/git4idea/branch/GitBranchWorkerTest.groovy +++ b/plugins/git4idea/tests/git4idea/branch/GitBranchWorkerTest.groovy @@ -525,8 +525,12 @@ class GitBranchWorkerTest extends GitLightTest { @Test public void "delete branch merged to head but unmerged to upstream should show dialog"() { // inspired by IDEA-83604 + // for the sake of simplicity we deal with a single myCommunity repository for remote operations + prepareRemoteRepoAndBranch(myCommunity) + cd myCommunity + git("checkout -b feature"); + git("push -u origin feature") - prepareRemoteRepoAndBranch("feature") // create a commit and merge it to master, but not to feature's upstream touch("feature.txt", "feature content") git("add feature.txt") @@ -544,25 +548,6 @@ class GitBranchWorkerTest extends GitLightTest { assertTrue "'Branch is not fully merged' dialog was not shown", dialogShown } - // for the sake of simplicity we deal with a single myCommunity repository for remote operations - private void prepareRemoteRepoAndBranch(String branch) { - // prepare parent repository - // create it under ultimate not to bother with removing it after the test (tearDown will clean automatically) - cd myUltimate - git("clone --bare $myCommunity parent.git") - - // initialize feature branch and push to make origin/feature, set up tracking - cd myCommunity - git("checkout -b $branch"); - git("remote add origin ${myUltimate.root.path}/parent.git"); - git("push -u origin $branch") - } - - @Test - void "delete remote branch without problems"() { - - } - @Test public void "simple merge without problems"() { branchWithCommit(myRepositories, "master2", "branch_file.txt", "branch content") diff --git a/plugins/git4idea/tests/git4idea/test/GitLightTest.groovy b/plugins/git4idea/tests/git4idea/test/GitLightTest.groovy index 831cea3a3d91..abf4bcd1d891 100644 --- a/plugins/git4idea/tests/git4idea/test/GitLightTest.groovy +++ b/plugins/git4idea/tests/git4idea/test/GitLightTest.groovy @@ -93,6 +93,18 @@ class GitLightTest { return repository } + /** + * Clones the given source repository into a bare parent.git and adds the remote origin. + */ + protected void prepareRemoteRepoAndBranch(GitRepository source) { + cd myTestRoot + git("clone --bare $source parent.git") + + // initialize feature branch and push to make origin/feature, set up tracking + cd source + git("remote add origin ${myTestRoot}/parent.git"); + } + private void registerRepository(GitRepositoryImpl repository) { ((GitTestRepositoryManager)myPlatformFacade.getRepositoryManager(myProject)).add(repository) }