in src/integrationTests/kotlin/IRGitPlatformTest.kt [65:106]
override fun setUp() {
System.setProperty("test.mode", "false")
super.setUp()
git = IRTestGitImpl()
ApplicationManager.getApplication().replaceService(Git::class.java, git, testRootDisposable)
repositoryManager = GitRepositoryManager.getInstance(project)
vcs = GitVcs.getInstance(project)
vcs.doActivate()
settings = GitVcsSettings.getInstance(project)
appSettings = GitVcsApplicationSettings.getInstance()
appSettings.setPathToGit(gitExecutable())
GitExecutableManager.getInstance().testGitExecutableVersionValid(project)
assumeSupportedGitVersion(vcs)
runBlocking(Dispatchers.IO) {
// This creates a new repository in the test project root
repository = createRepository(project, projectNioRoot, true)
git("config --global init.defaultBranch main")
initialCommitOnMain = git("rev-list --max-parents=0 HEAD")
// This creates a new branch called "development",
// and leaves the state to the new branch (checked out on branch "development")
repository.checkoutNew(developmentBranch)
assertCorrectCheckedOutBranch(developmentBranch)
firstCommitOnDev = createAndCommitNewFile("file1.txt", "first")
secondCommitOnDev = createAndCommitNewFile("file2.txt", "code quality")
thirdCommitOnDev = createAndCommitNewFile("file3.txt", "i love testing")
fourthCommitOnDev = createAndCommitNewFile("file4.txt", "my final commit")
Awaitility.await()
.alias("setup has 4 commits")
.pollInSameThread()
.atMost(10000, TimeUnit.MILLISECONDS)
.pollDelay(50, TimeUnit.MILLISECONDS)
.until { gitCommitsCountEquals(4) }
}
}