void () { boolean hasProtectedBranch = PushUtils.getProhibitedTarget(this) != null; GitVcsSettings vcsSettings = GitVcsSettings.getInstance(myProject); boolean showDialog = vcsSettings.shouldPreviewPushOnCommitAndPush(); boolean showOnlyProtected = vcsSettings.isPreviewPushProtectedOnly(); if (showDialog && (!showOnlyProtected || hasProtectedBranch) || !canPush()) { show(); } else { push(false); } }