git: add description to update action when no tracking branch exist

GitOrigin-RevId: e499efb89b0f1ada9f5fe7d2df8253fa534790d5
This commit is contained in:
Dmitry Zhuravlev
2019-12-18 17:12:26 +00:00
committed by intellij-monorepo-bot
parent 1177844617
commit 810b1534bd
2 changed files with 11 additions and 2 deletions
@@ -807,7 +807,12 @@ public class GitBranchPopupActions {
presentation.setDescription("Update is already running");
return;
}
presentation.setEnabled(isTrackingInfosExist(myBranchNameList, myRepositories));
boolean trackingInfosExist = isTrackingInfosExist(myBranchNameList, myRepositories);
presentation.setEnabled(trackingInfosExist);
if (!trackingInfosExist) {
presentation.setDescription(String.format("Tracking branch doesn't configured for %s", branchPresentation));
}
}
@Override
@@ -139,7 +139,11 @@ internal object BranchesDashboardActions {
val pluralizedBranchName = StringUtil.pluralize("branch", branchNames.size)
presentation.description =
"Fetch remote tracking $pluralizedBranchName and fast-forward selected local $pluralizedBranchName (like `git fetch branch:branch`)"
presentation.isEnabled = isTrackingInfosExist(branchNames, repositories)
val trackingInfosExist = isTrackingInfosExist(branchNames, repositories)
presentation.isEnabled = trackingInfosExist
if (!trackingInfosExist) {
presentation.description = "Tracking branch doesn't configured for selected $pluralizedBranchName"
}
}
override fun actionPerformed(e: AnActionEvent) {