@ -49,20 +49,15 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail ;
import java.io.File ;
import java.io.IOException ;
import java.util.Iterator ;
import org.eclipse.jgit.api.MergeResult.MergeStatus ;
import org.eclipse.jgit.api.errors.InvalidMergeHeadsException ;
import org.eclipse.jgit.dircache.DirCacheCheckout ;
import org.eclipse.jgit.lib.Constants ;
import org.eclipse.jgit.lib.ObjectId ;
import org.eclipse.jgit.lib.RefUpdate ;
import org.eclipse.jgit.lib.RepositoryState ;
import org.eclipse.jgit.lib.RepositoryTestCase ;
import org.eclipse.jgit.merge.MergeStrategy ;
import org.eclipse.jgit.revwalk.RevCommit ;
import org.eclipse.jgit.revwalk.RevWalk ;
import org.junit.Test ;
public class MergeCommandTest extends RepositoryTestCase {
@ -163,7 +158,6 @@ public class MergeCommandTest extends RepositoryTestCase {
}
}
@Test
public void testContentMerge ( ) throws Exception {
Git git = new Git ( db ) ;
@ -795,25 +789,4 @@ public class MergeCommandTest extends RepositoryTestCase {
assertEquals ( null , result . getConflicts ( ) ) ;
assertEquals ( RepositoryState . SAFE , db . getRepositoryState ( ) ) ;
}
private void createBranch ( ObjectId objectId , String branchName ) throws IOException {
RefUpdate updateRef = db . updateRef ( branchName ) ;
updateRef . setNewObjectId ( objectId ) ;
updateRef . update ( ) ;
}
private void checkoutBranch ( String branchName ) throws IllegalStateException , IOException {
RevWalk walk = new RevWalk ( db ) ;
RevCommit head = walk . parseCommit ( db . resolve ( Constants . HEAD ) ) ;
RevCommit branch = walk . parseCommit ( db . resolve ( branchName ) ) ;
DirCacheCheckout dco = new DirCacheCheckout ( db ,
head . getTree ( ) . getId ( ) , db . lockDirCache ( ) ,
branch . getTree ( ) . getId ( ) ) ;
dco . setFailOnConflict ( true ) ;
dco . checkout ( ) ;
walk . release ( ) ;
// update the HEAD
RefUpdate refUpdate = db . updateRef ( Constants . HEAD ) ;
refUpdate . link ( branchName ) ;
}
}