@Override public boolean matches(Pride pride, Module module) throws IOException { String branch = module.getVcs().getSupport().getBranch(pride.getModuleDirectory(module.getName())); if (Strings.isNullOrEmpty(branch)) { branch = module.getVcs().getSupport().getDefaultBranch(); } return branchPattern.matcher(branch).matches(); }
@Override protected void execute(Pride pride, Module module) throws IOException { File moduleDir = pride.getModuleDirectory(module.getName()); String moduleBranch = explicitSwitchToBranch; if (Strings.isNullOrEmpty(moduleBranch)) { moduleBranch = module.getVcs().getSupport().getBranch(pride.getModuleDirectory(module.getName())); } module.getVcs().getSupport().update(moduleDir, moduleBranch, recursive, false); }