Examples of branchCreate()


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

      Repository repo = git.getRepository();
      String originalBranch = repo.getFullBranch();
      boolean empty = repo.resolve(Constants.HEAD) == null;
      if (!empty) {
        if (repo.getRef(branch) == null)
          git.branchCreate().setName(branch).call();
        git.checkout().setName(branch).call();
      }

      writeTrashFile(filename, contents);
      git.add().addFilepattern(filename).call();
View Full Code Here

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

          .setMessage(branch + ": " + filename).call();

      if (originalBranch != null)
        git.checkout().setName(originalBranch).call();
      else if (empty)
        git.branchCreate().setName(branch).setStartPoint(commit).call();

      return commit;
    } catch (IOException e) {
      throw new RuntimeException(e);
    } catch (GitAPIException e) {
View Full Code Here

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

      if (secondCheckout) {
        git.checkout().setStartPoint(revWalk.parseCommit(commitId))
            .setName("refs/heads/master").setCreateBranch(true)
            .call();
      } else {
        git.branchCreate().setName("refs/heads/next")
            .setStartPoint(commitId.name()).call();
        git.checkout().setName("refs/heads/next")
            .call();
      }
      if (!good)
View Full Code Here

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

    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit1").call();
    assertFalse(db.getFS().canExecute(file));

    // Create branch
    git.branchCreate().setName("b1").call();

    // Make file executable
    db.getFS().setExecute(file, true);
    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit2").call();
View Full Code Here

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

    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit1").call();
    assertFalse(db.getFS().canExecute(file));

    // Create branch
    git.branchCreate().setName("b1").call();

    // Make file executable
    db.getFS().setExecute(file, true);
    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit2").call();
View Full Code Here

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

    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit1").call();
    assertFalse(db.getFS().canExecute(file));

    // Create branch
    git.branchCreate().setName("b1").call();

    // Create second commit and don't touch file
    writeTrashFile("file2.txt", "");
    git.add().addFilepattern("file2.txt").call();
    git.commit().setMessage("commit2").call();
View Full Code Here

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

    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit1").call();
    assertFalse(db.getFS().canExecute(file));

    // Create branch
    git.branchCreate().setName("b1").call();

    // Create second commit with executable file
    file = writeTrashFile("file.txt", "b");
    db.getFS().setExecute(file, true);
    git.add().addFilepattern("file.txt").call();
View Full Code Here

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

    writeTrashFile("D/g", "g()");
    git.add().addFilepattern(".").call();
    git.commit().setMessage("inital").call();
    assertIndex(mkmap("f", "f()", "D/g", "g()"));

    git.branchCreate().setName("topic").call();

    writeTrashFile("f", "f()\nmaster");
    writeTrashFile("D/g", "g()\ng2()");
    writeTrashFile("E/h", "h()");
    git.add().addFilepattern(".").call();
View Full Code Here

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

    writeTrashFile(fname, "a");
    git.add().addFilepattern(fname).call();
    git.commit().setMessage("create file").call();

    // Create branch
    git.branchCreate().setName("side").call();

    // Modify file
    writeTrashFile(fname, "b");
    git.add().addFilepattern(fname).call();
    git.commit().setMessage("modify file").call();
View Full Code Here

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

    db.getConfig().save();
    writeTrashFile("crlf.txt", "some\r\ndata\r\n");
    git.add().addFilepattern("crlf.txt").call();
    git.commit().setMessage("base").call();

    git.branchCreate().setName("brancha").call();

    writeTrashFile("crlf.txt", "some\r\nmore\r\ndata\r\n");
    git.add().addFilepattern("crlf.txt").call();
    git.commit().setMessage("on master").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.