Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.checkout()


    writeTrashFile("d/1", "modified");
    RevCommit masterCommit = git.commit().setAll(true)
        .setMessage("modified d/1 on master").call();

    git.checkout().setCreateBranch(true).setStartPoint(first)
        .setName("side").call();
    writeTrashFile("d/1", "modified");
    RevCommit sideCommit = git.commit().setAll(true)
        .setMessage("modified d/1 on side").call();
View Full Code Here


    writeTrashFile("d/1", "orig");
    git.add().addFilepattern("d/1").call();
    RevCommit masterCommit = git.commit().setAll(true)
        .setMessage("added d/1 on master").call();

    git.checkout().setCreateBranch(true).setStartPoint(first)
        .setName("side").call();
    writeTrashFile("d/1", "orig");
    git.add().addFilepattern("d/1").call();
    git.commit().setAll(true).setMessage("added d/1 on side").call();
View Full Code Here

    writeTrashFile("d/1", "master");
    git.add().addFilepattern("d/1").call();
    RevCommit masterCommit = git.commit().setAll(true)
        .setMessage("added d/1 on master").call();

    git.checkout().setCreateBranch(true).setStartPoint(first)
        .setName("side").call();
    writeTrashFile("d/1", "side");
    git.add().addFilepattern("d/1").call();
    git.commit().setAll(true).setMessage("added d/1 on side").call();
View Full Code Here

    writeTrashFile("0", "master");
    RevCommit masterCommit = git.commit().setAll(true)
        .setMessage("modified 0 on master").call();

    git.checkout().setCreateBranch(true).setStartPoint(first)
        .setName("side").call();
    writeTrashFile("0", "side");
    git.commit().setAll(true).setMessage("modified 0 on side").call();

    git.rm().addFilepattern("0").call();
View Full Code Here

    writeTrashFile("1", "1master\n2\n3");
    RevCommit masterCommit = git.commit().setAll(true)
        .setMessage("modified 1 on master").call();

    git.checkout().setCreateBranch(true).setStartPoint(first)
        .setName("side").call();
    writeTrashFile("1", "1\n2\n3side");
    git.commit().setAll(true).setMessage("modified 1 on side").call();

    git.rm().addFilepattern("0").call();
View Full Code Here

    writeTrashFile("1", "1master2\n2\n3");
    git.commit().setAll(true)
        .setMessage("modified 1 on master again").call();

    git.checkout().setCreateBranch(true).setStartPoint(first)
        .setName("side").call();
    writeTrashFile("1", "1\n2\na\nb\nc\n3side");
    RevCommit sideCommit = git.commit().setAll(true)
        .setMessage("modified 1 on side").call();
View Full Code Here

    MergeResult result = git.merge().setStrategy(strategy)
        .include(masterCommit).call();
    assertEquals(MergeStatus.MERGED, result.getMergeStatus());
    result.getNewHead();
    git.checkout().setName("master").call();
    result = git.merge().setStrategy(strategy).include(sideCommit).call();
    assertEquals(MergeStatus.MERGED, result.getMergeStatus());

    // we have two branches which are criss-cross merged. Try to merge the
    // tips. This should succeed with RecursiveMerge and fail with
View Full Code Here

    defaultDb = createWorkRepository();
    Git git = new Git(defaultDb);
    JGitTestUtil.writeTrashFile(defaultDb, "hello.txt", "branch world");
    git.add().addFilepattern("hello.txt").call();
    oldCommitId = git.commit().setMessage("Initial commit").call().getId();
    git.checkout().setName(BRANCH).setCreateBranch(true).call();
    git.checkout().setName("master").call();
    git.tag().setName(TAG).call();
    JGitTestUtil.writeTrashFile(defaultDb, "hello.txt", "master world");
    git.add().addFilepattern("hello.txt").call();
    git.commit().setMessage("Second commit").call();
View Full Code Here

    Git git = new Git(defaultDb);
    JGitTestUtil.writeTrashFile(defaultDb, "hello.txt", "branch world");
    git.add().addFilepattern("hello.txt").call();
    oldCommitId = git.commit().setMessage("Initial commit").call().getId();
    git.checkout().setName(BRANCH).setCreateBranch(true).call();
    git.checkout().setName("master").call();
    git.tag().setName(TAG).call();
    JGitTestUtil.writeTrashFile(defaultDb, "hello.txt", "master world");
    git.add().addFilepattern("hello.txt").call();
    git.commit().setMessage("Second commit").call();
View Full Code Here

    git.rm().addFilepattern("folder1/file1.txt")
        .addFilepattern("folder1/file2.txt").call();
    RevCommit other = git.commit()
        .setMessage("removing folders on 'other'").call();

    git.checkout().setName(base.name()).call();

    file = new File(db.getWorkTree(), "unrelated.txt");
    write(file, "unrelated");

    git.add().addFilepattern("unrelated.txt").call();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.