}
BeanManager beanManager = CDIUtils.lookUpBeanManager(commandContext);
logger.debug("BeanManager " + beanManager);
IOService ioService = CDIUtils.createBean(IOService.class, beanManager, new NamedLiteral("ioStrategy"));
logger.debug("IoService " + ioService);
Path fromBranchPath = ioService.get(URI.create("default://" + fromBranchName + "@" + gitRepo));
Path toBranchPath = ioService.get(URI.create("default://" + toBranchName + "@" + gitRepo));
CherryPickCopyOption copyOption = new CherryPickCopyOption(orderedCommits);
String outcome = "unknown";
try {
logger.debug("Cherry pick command execution");
ioService.copy(fromBranchPath, toBranchPath, copyOption);
outcome = "success";
} catch (Exception e) {
outcome = "failure : " + e.getMessage();
logger.error("Error when cherry picking commits from {} to {}", fromBranchName, toBranchName, e);