/** {@inheritDoc} */ @Override public boolean merge(AnyObjectId... tips) throws IOException { if (tips.length != 2) return false; return super.merge(tips); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(Repository db, boolean inCore) { return new ResolveMerger(db, inCore); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(Repository db) { return new InCoreMerger(db); }
private void writeConflictMetadata(MergeChunk chunk) throws IOException { if (lastConflictingName != null && chunk.getConflictState() != ConflictState.NEXT_CONFLICTING_RANGE) { // found the end of an conflict writeConflictEnd(); } if (chunk.getConflictState() == ConflictState.FIRST_CONFLICTING_RANGE) { // found the start of an conflict writeConflictStart(chunk); } else if (chunk.getConflictState() == ConflictState.NEXT_CONFLICTING_RANGE) { // found another conflicting chunk writeConflictChange(chunk); } }
private MergeConfig(String branch, Config config) { String[] mergeOptions = getMergeOptions(branch, config); fastForwardMode = getFastForwardMode(config, mergeOptions); squash = isMergeConfigOptionSet("--squash", mergeOptions); //$NON-NLS-1$ commit = !isMergeConfigOptionSet("--no-commit", mergeOptions); //$NON-NLS-1$ }
private void writeConflictChange(MergeChunk chunk) throws IOException { /* * In case of a non-three-way merge I'll add the name of the conflicting * chunk behind the equal signs. I also append the name of the last * conflicting chunk after the ending greater-than signs. If somebody * knows a better notation to present non-three-way merges - feel free * to correct here. */ lastConflictingName = seqName.get(chunk.getSequenceIndex()); writeln(threeWayMerge ? "=======" : "======= " //$NON-NLS-1$ //$NON-NLS-2$ + lastConflictingName); }
/** {@inheritDoc} */ @Override public Merger newMerger(Repository db) { return new OneSide(db, treeIndex); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(ObjectInserter inserter, Config config) { return new RecursiveMerger(inserter, config); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(Repository db, boolean inCore) { // This class is always inCore, so ignore the parameter return newMerger(db); }
/** * {@inheritDoc} * <p> * Get a single base commit for two given commits. If the two source commits * have more than one base commit recursively merge the base commits * together until you end up with a single base commit. */ @Override protected RevCommit getBaseCommit(RevCommit a, RevCommit b) throws IncorrectObjectTypeException, IOException { return getBaseCommit(a, b, 0); }
/** * Begin a new line if not already in one. * * @exception IOException * if an I/O error occurs. */ void beginln() throws IOException { if (!bol) write('\n'); }
@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()); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(ObjectInserter inserter, Config config) { return new ResolveMerger(inserter, config); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(ObjectInserter inserter, Config config) { return new InCoreMerger(inserter); }
/** {@inheritDoc} */ @Override public Merger newMerger(ObjectInserter inserter, Config config) { return new OneSide(inserter, treeIndex); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(Repository db, boolean inCore) { return new RecursiveMerger(db, inCore); }
@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); }
/** {@inheritDoc} */ @Override public ThreeWayMerger newMerger(Repository db) { return new ResolveMerger(db, false); }
command.setStrategy(MergeStrategy.get(strategy.toString()));