diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index 7caf73c09b36..e647d68c5d2a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -761,17 +761,14 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj @NotNull private static String getCommitActionName(@NotNull Collection affectedVcses) { - String name = null; - for (AbstractVcs vcs : affectedVcses) { + Set names = map2SetNotNull(affectedVcses, vcs -> { CheckinEnvironment checkinEnvironment = vcs.getCheckinEnvironment(); - if (name == null && checkinEnvironment != null) { - name = checkinEnvironment.getCheckinOperationName(); - } - else { - name = VcsBundle.getString("commit.dialog.default.commit.operation.name"); - } + return checkinEnvironment != null ? checkinEnvironment.getCheckinOperationName() : null; + }); + if (names.size() == 1) { + return notNull(ContainerUtil.getFirstItem(names)); } - return name != null ? name : VcsBundle.getString("commit.dialog.default.commit.operation.name"); + return VcsBundle.getString("commit.dialog.default.commit.operation.name"); } private boolean checkComment() {