diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java index 640daf228d93..75cd93b967bc 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchPopupActions.java @@ -277,7 +277,6 @@ public class GitBranchPopupActions { new CheckoutAction(myProject, myRepositories, myBranchName), new CheckoutAsNewBranch(myProject, myRepositories, myBranchName), new CheckoutWithRebaseAction(myProject, myRepositories, myBranchName), - new UpdateSelectedBranchAction(myProject, myRepositories, myBranchName), new Separator(), new CompareAction(myProject, myRepositories, myBranchName), new ShowDiffWithBranchAction(myProject, myRepositories, myBranchName), @@ -285,6 +284,7 @@ public class GitBranchPopupActions { new RebaseAction(myProject, myRepositories, myBranchName), new MergeAction(myProject, myRepositories, myBranchName, true), new Separator(), + new UpdateSelectedBranchAction(myProject, myRepositories, myBranchName, hasIncomingCommits()), new PushBranchAction(myProject, myRepositories, myBranchName, hasOutgoingCommits()), new Separator(), new RenameBranchAction(myProject, myRepositories, myBranchName), @@ -771,18 +771,23 @@ public class GitBranchPopupActions { } } - private static class UpdateSelectedBranchAction extends DumbAwareAction { + private static class UpdateSelectedBranchAction extends DumbAwareAction implements CustomIconProvider { private final Project myProject; private final List myRepositories; private final String myBranchName; private final List myBranchNameList; + private final boolean myHasIncoming; - UpdateSelectedBranchAction(@NotNull Project project, @NotNull List repositories, @NotNull String branchName) { - super("Update", null, AllIcons.Actions.CheckOut); + UpdateSelectedBranchAction(@NotNull Project project, + @NotNull List repositories, + @NotNull String branchName, + boolean hasIncoming) { + super("Update"); myProject = project; myRepositories = repositories; myBranchName = branchName; myBranchNameList = Collections.singletonList(branchName); + myHasIncoming = hasIncoming; } @Override @@ -804,6 +809,12 @@ public class GitBranchPopupActions { public void actionPerformed(@NotNull AnActionEvent e) { updateBranches(myProject, myRepositories, myBranchNameList); } + + @Nullable + @Override + public Icon getRightIcon() { + return myHasIncoming ? DvcsImplIcons.Incoming : null; + } } static class TagActions extends BranchActionGroup {