<commit_before>package gitflow.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFileManager;
import git4idea.branch.GitBranchUtil;
import git4idea.merge.GitMerger;
import git4idea.repo.GitRepository;
import gitflow.Gitflow;
import gitflow.GitflowBranchUtil;
import gitflow.GitflowBranchUtilManager;
import gitflow.GitflowConfigUtil;
import gitflow.ui.NotifyUtil;

import java.util.ArrayList;

public class GitflowAction extends DumbAwareAction {
    Project myProject;
    Gitflow myGitflow = ServiceManager.getService(Gitflow.class);
    ArrayList<GitRepository> repos = new ArrayList<GitRepository>();
    GitRepository myRepo;
    GitflowBranchUtil branchUtil;

    VirtualFileManager virtualFileMananger;


    String currentBranchName;

    String featurePrefix;
    String releasePrefix;
    String hotfixPrefix;
    String masterBranch;
    String developBranch;

    GitflowAction( String actionName){ super(actionName); }

    GitflowAction(GitRepository repo, String actionName){
        super(actionName);
        myRepo = repo;
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        setup(e.getProject());
    }

    public void setup(Project project){
        myProject = project;
        virtualFileMananger = VirtualFileManager.getInstance();

        featurePrefix = GitflowConfigUtil.getFeaturePrefix(myProject, myRepo);
        releasePrefix = GitflowConfigUtil.getReleasePrefix(myProject, myRepo);
        hotfixPrefix= GitflowConfigUtil.getHotfixPrefix(myProject, myRepo);
        masterBranch= GitflowConfigUtil.getMasterBranch(myProject, myRepo);
        developBranch= GitflowConfigUtil.getDevelopBranch(myProject, myRepo);

        branchUtil= GitflowBranchUtilManager.getBranchUtil(myRepo);

        currentBranchName= GitBranchUtil.getBranchNameOrRev(myRepo);<commit_msg>Fix #151 Starting a release does always tell the branch is already checked out<commit_after>package gitflow.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFileManager;
import git4idea.branch.GitBranchUtil;
import git4idea.merge.GitMerger;
import git4idea.repo.GitRepository;
import gitflow.Gitflow;
import gitflow.GitflowBranchUtil;
import gitflow.GitflowBranchUtilManager;
import gitflow.GitflowConfigUtil;
import gitflow.ui.NotifyUtil;

import java.util.ArrayList;

public class GitflowAction extends DumbAwareAction {
    Project myProject;
    Gitflow myGitflow = ServiceManager.getService(Gitflow.class);
    ArrayList<GitRepository> repos = new ArrayList<GitRepository>();
    GitRepository myRepo;
    GitflowBranchUtil branchUtil;

    VirtualFileManager virtualFileMananger;


    String currentBranchName;

    String featurePrefix;
    String releasePrefix;
    String hotfixPrefix;
    String masterBranch;
    String developBranch;

    GitflowAction( String actionName){ super(actionName); }

    GitflowAction(GitRepository repo, String actionName){
        super(actionName);
        myRepo = repo;
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        setup(e.getProject());
    }

    public void setup(Project project){
        myProject = project;
        virtualFileMananger = VirtualFileManager.getInstance();
        repos.add(myRepo);

        featurePrefix = GitflowConfigUtil.getFeaturePrefix(myProject, myRepo);
        releasePrefix = GitflowConfigUtil.getReleasePrefix(myProject, myRepo);
        hotfixPrefix= GitflowConfigUtil.getHotfixPrefix(myProject, myRepo);
        masterBranch= GitflowConfigUtil.getMasterBranch(myProject, myRepo);
        developBranch= GitflowConfigUtil.getDevelopBranch(myProject, myRepo);

        branchUtil= GitflowBranchUtilManager.getBranchUtil(myRepo);

        currentBranchName= GitBranchUtil.getBranchNameOrRev(myRepo);
{'fraction_non_alphanumeric': 0.07786506469500924, 'fraction_numerical': 0.0020794824399260627, 'mean_word_length': 4.802949061662199, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2963417', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1254, 'n_words': 233}