Repository (@NotNull String name, Project project) { String tempDirectory; try { tempDirectory = FileUtil.createTempDirectory("foo", "bar").getPath(); } catch (IOException e) { throw new RuntimeException(e); } String root = tempDirectory + "/" + name; assertTrue(new File(root).mkdirs()); GitRepository repository = GitTestUtil.createRepository(project, root); GitBranchesCollection branches = repository.getBranches(); assertEquals(1, branches.getLocalBranches().size()); ProjectLevelVcsManager.getInstance(project).getStandardConfirmation(VcsConfiguration.StandardConfirmation.ADD, repository.getVcs()).setValue( VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY); return repository; }