vcs: commit action text should not depend on order of affected vcses

* fix case, when one of affected vcses doesn't have a CheckinEnvironment
This commit is contained in:
Aleksey Pivovarov
2018-04-10 16:17:35 +03:00
parent 53d621eb92
commit 5d5e35cae6
@@ -761,17 +761,14 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
@NotNull
private static String getCommitActionName(@NotNull Collection<AbstractVcs> affectedVcses) {
String name = null;
for (AbstractVcs vcs : affectedVcses) {
Set<String> 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() {