Github: fix invalid condition

we should warn when there are not merged commits, not when there are no of them

* fix error message spacing
This commit is contained in:
Aleksey Pivovarov
2014-04-19 12:48:15 +04:00
parent dda5341c98
commit 95d057d3ce
@@ -306,16 +306,16 @@ public class GithubCreatePullRequestWorker {
return true;
}
if (info.getInfo().getBranchToHeadCommits(myGitRepository).isEmpty()) {
GithubNotifications.showWarningDialog(myProject, CANNOT_CREATE_PULL_REQUEST, "Can't create empty pull request: the branch" +
GithubNotifications.showWarningDialog(myProject, CANNOT_CREATE_PULL_REQUEST, "Can't create empty pull request: the branch " +
getCurrentBranch() +
" in fully merged to the branch " +
targetBranch +
".");
return false;
}
if (info.getInfo().getHeadToBranchCommits(myGitRepository).isEmpty()) {
if (!info.getInfo().getHeadToBranchCommits(myGitRepository).isEmpty()) {
return GithubNotifications
.showYesNoDialog(myProject, "The branch" + targetBranch + " in not fully merged to the branch " + getCurrentBranch(),
.showYesNoDialog(myProject, "The branch " + targetBranch + " in not fully merged to the branch " + getCurrentBranch(),
"Do you want to proceed anyway?") == Messages.YES;
}