boolean (@NotNull GitRepository repository, @NotNull GitMessageWithFilesDetector localChangesOverwrittenByCheckout, @NotNull StructuredIdeActivity activity) { Pair<List<GitRepository>, List<Change>> conflictingRepositoriesAndAffectedChanges = getConflictingRepositoriesAndAffectedChanges(repository, localChangesOverwrittenByCheckout, myCurrentHeads.get(repository), myStartPointReference); List<GitRepository> allConflictingRepositories = conflictingRepositoriesAndAffectedChanges.getFirst(); List<Change> affectedChanges = conflictingRepositoriesAndAffectedChanges.getSecond(); Collection<String> absolutePaths = toAbsolute(repository.getRoot(), localChangesOverwrittenByCheckout.getRelativeFilePaths()); //activity.stageWithDurationStarted(IN_UI); GitSmartOperationDialog.Choice decision = myUiHandler.showSmartOperationDialog(myProject, affectedChanges, absolutePaths, GitBundle.message("checkout.operation.name"), GitBundle.message("checkout.operation.force.checkout")); if (decision == SMART) { Hash startHash = getHead(repository); boolean smartCheckedOutSuccessfully = smartCheckout(allConflictingRepositories, myStartPointReference, myNewBranch, getIndicator(), activity); if (smartCheckedOutSuccessfully) { for (GitRepository conflictingRepository : allConflictingRepositories) { markSuccessful(conflictingRepository); StructuredIdeActivity vfsRefresh = VFS_REFRESH.startedWithParent(myProject, activity); updateAndRefreshChangedVfs(conflictingRepository, startHash); vfsRefresh.finished(); } return true; } else { // notification is handled in smartCheckout() return false; } } else if (decision == FORCE) { Map<GitRepository, Collection<Change>> changesToRefresh = StreamEx.of(allConflictingRepositories).toMap(repo -> { return GitChangeUtils.getDiffWithWorkingTree(repo, myStartPointReference, false); }); boolean forceCheckoutSucceeded = checkoutOrNotify(allConflictingRepositories, myStartPointReference, myNewBranch, true, activity); if (forceCheckoutSucceeded) { markSuccessful(allConflictingRepositories.toArray(new GitRepository[0])); updateRepositories(allConflictingRepositories); StructuredIdeActivity vfsRefresh = VFS_REFRESH.startedWithParent(myProject, activity); allConflictingRepositories.forEach(repo -> refreshVfs(repo.getRoot(), changesToRefresh.get(repo))); vfsRefresh.finished(); } return forceCheckoutSucceeded; } else { fatalLocalChangesError(myStartPointReference); return false; } }