@Signature public Memory stashApply(ArrayMemory settings) throws GitAPIException { StashApplyCommand command = getWrappedObject().stashApply(); if (settings != null) { command.setApplyIndex(settings.valueOfIndex("applyIndex").toBoolean()); command.setApplyUntracked(settings.valueOfIndex("applyUntracked").toBoolean()); Memory stashRef = settings.valueOfIndex("stashRef"); if (stashRef.isNotNull()) { command.setStashRef(stashRef.toString()); } Memory strategy = settings.valueOfIndex("strategy"); if (strategy.isNotNull()) { command.setStrategy(MergeStrategy.get(strategy.toString())); } } return GitUtils.valueOf(command.call()); }
mergeStrategy = MergeStrategy.get(strategyName); if (mergeStrategy == null) throw die(MessageFormat.format(
@Signature public Memory merge(String[] refs, ArrayMemory settings) throws IOException, GitAPIException { MergeCommand command = getWrappedObject().merge(); for (String ref : refs) { Repository repository = getWrappedObject().getRepository(); ObjectId objectId = repository.resolve(ref); command.include(objectId); } if (settings != null) { command.setCommit(settings.valueOfIndex("commit").toBoolean()); command.setMessage(settings.valueOfIndex("message").toString()); command.setSquash(settings.valueOfIndex("squash").toBoolean()); Memory fastForward = settings.valueOfIndex("fastForward"); if (fastForward.isNumber()) { command.setFastForward(MergeCommand.FastForwardMode.valueOf(fastForward.toString())); } Memory strategy = settings.valueOfIndex("strategy"); if (strategy.isNotNull()) { command.setStrategy(MergeStrategy.get(strategy.toString())); } } MergeResult call = command.call(); return GitUtils.valueOf(call); }
command.setStrategy(MergeStrategy.get(strategy.toString()));