package ee.shy.cli.command.branch;

import ee.shy.cli.Command;
import ee.shy.core.Repository;

import java.io.IOException;

/**
 * Command for removing branches.
 */
public class RemoveCommand implements Command {
    @Override
    public void execute(String[] args) throws IOException {
        Repository.newExisting().getBranches().remove(args[0]);
    }

    @Override
    public String getHelp() {
        return null;
    }

    @Override
    public String getHelpBrief() {
        return null;
    }
}

@@ -303,51 +303,278 @@
 tory
-.newExisting().getBranches().remove(args%5B0%5D
+ repository = Repository.newExisting();%0A        if (!args%5B0%5D.equals(repository.getCurrent().getBranch()))%0A            repository.getBranches().remove(args%5B0%5D);%0A        else%0A            System.err.println(%22Branch %22 + args%5B0%5D + %22 can't be removed because it's checked out%22
 );%0A 

Fix current branch being removable