boolean (Project currentProject, @NotNull Path directory, VcsKey vcsKey) { Project project = CompositeCheckoutListener.findProjectByBaseDirLocation(directory); if (project == null) { return false; } ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project); if (!vcsManager.hasAnyMappings()) { vcsManager.setDirectoryMappings(Collections.singletonList(VcsDirectoryMapping.createDefault(vcsKey.getName()))); } return true; }