package zielu.gittoolbox.ui.statusBar;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
import git4idea.i18n.GitBundle;
import git4idea.repo.GitRepository;
import org.jetbrains.annotations.NotNull;
import zielu.gittoolbox.fetch.GtFetchUtil;

public class FetchAction extends DumbAwareAction {
    private final GitRepository myRepository;

    public FetchAction(@NotNull GitRepository repository) {
        super(GitBundle.getString("fetch.action.name"));
        myRepository = repository;
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        GtFetchUtil.fetch(myRepository);
    }
}

@@ -121,31 +121,151 @@
 api.
-project.DumbAwareAction
+actionSystem.Presentation;%0Aimport com.intellij.openapi.project.DumbAwareAction;%0Aimport git4idea.GitLocalBranch;%0Aimport git4idea.GitRemoteBranch
 ;%0Aim
@@ -631,16 +631,16 @@
 ame%22));%0A
-
         
@@ -673,16 +673,618 @@
 %0A    %7D%0A%0A
+    @Override%0A    public void update(AnActionEvent e) %7B%0A        super.update(e);%0A        Presentation presentation = e.getPresentation();%0A        presentation.setEnabled(false);%0A        GitLocalBranch branch = myRepository.getCurrentBranch();%0A        if (branch != null) %7B%0A            GitRemoteBranch trackedBranch = branch.findTrackedBranch(myRepository);%0A            if (trackedBranch != null) %7B%0A                presentation.setText(GitBundle.getString(%22fetch.action.name%22)+%22 %22+trackedBranch.getNameForLocalOperations());%0A                presentation.setEnabled(true);%0A            %7D%0A        %7D%0A    %7D%0A%0A
     @Ove

Include branch name in fetch