List<VcsException> (@NotNull List<? extends Change> changes, @NotNull @NonNls String commitMessage, @NotNull CommitContext commitContext, @NotNull Set<? super String> feedback) { updateState(commitContext); List<VcsException> exceptions = new ArrayList<>(); Map<GitRepository, Collection<Change>> sortedChanges = sortChangesByGitRoot(myProject, changes, exceptions); Collection<VcsRoot> commitWithoutChangesRoots = getCommitWithoutChangesRoots(commitContext); LOG.assertTrue(!sortedChanges.isEmpty() || !commitWithoutChangesRoots.isEmpty(), "Trying to commit an empty list of changes: " + changes); List<GitRepository> repositories = collectRepositories(sortedChanges.keySet(), commitWithoutChangesRoots); for (GitRepository repository : repositories) { Collection<Change> rootChanges = sortedChanges.getOrDefault(repository, emptyList()); Collection<CommitChange> toCommit = collectChangesToCommit(rootChanges); if (isCommitRenamesSeparately(commitContext)) { Pair<Collection<CommitChange>, List<VcsException>> pair = commitExplicitRenames(repository, toCommit, commitMessage); toCommit = pair.first; List<VcsException> moveExceptions = pair.second; if (!moveExceptions.isEmpty()) { exceptions.addAll(moveExceptions); continue; } } exceptions.addAll(commitRepository(repository, toCommit, commitMessage, commitContext)); } if (isPushAfterCommit(commitContext) && exceptions.isEmpty()) { GitPushAfterCommitDialog.showOrPush(myProject, repositories); } return exceptions; }