Examples of TreeFormatter


Examples of org.eclipse.jgit.lib.TreeFormatter

    // open when we create it we won't write the object file out as a loose
    // object (as it already exists in the pack).
    //
    final Repository newdb = createBareRepository();
    final ObjectInserter oi = newdb.newObjectInserter();
    final ObjectId treeId = oi.insert(new TreeFormatter());
    oi.release();

    assertEquals("4b825dc642cb6eb9a060e54bf8d69288fbee4904", treeId.name());
    final File o = new File(new File(new File(newdb.getDirectory(),
        "objects"), "4b"), "825dc642cb6eb9a060e54bf8d69288fbee4904");
View Full Code Here

Examples of org.eclipse.jgit.lib.TreeFormatter

  @Test
  public void test002_WriteEmptyTree2() throws IOException {
    // File shouldn't exist as it is in a test pack.
    //
    final ObjectId treeId = insertTree(new TreeFormatter());
    assertEquals("4b825dc642cb6eb9a060e54bf8d69288fbee4904", treeId.name());
    final File o = new File(new File(
        new File(db.getDirectory(), "objects"), "4b"),
        "825dc642cb6eb9a060e54bf8d69288fbee4904");
    assertFalse("Exists " + o, o.isFile());
View Full Code Here

Examples of org.eclipse.jgit.lib.TreeFormatter

    }
  }

  @Test
  public void test009_CreateCommitOldFormat() throws IOException {
    final ObjectId treeId = insertTree(new TreeFormatter());
    final CommitBuilder c = new CommitBuilder();
    c.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
    c.setCommitter(new PersonIdent(committer, 1154236443000L, -4 * 60));
    c.setMessage("A Commit\n");
    c.setTreeId(treeId);
View Full Code Here

Examples of org.eclipse.jgit.lib.TreeFormatter

    final ObjectInserter oi = db.newObjectInserter();
    try {
      final ObjectId blobId = oi.insert(Constants.OBJ_BLOB,
          "and this is the data in me\n".getBytes(Constants.CHARSET
              .name()));
      TreeFormatter fmt = new TreeFormatter();
      fmt.append("i-am-a-file", FileMode.REGULAR_FILE, blobId);
      treeId = oi.insert(fmt);
      oi.flush();
    } finally {
      oi.release();
    }
View Full Code Here

Examples of org.eclipse.jgit.lib.TreeFormatter

        // Create a blob object to insert into a tree
        ObjectId blobId = odi.insert(Constants.OBJ_BLOB,
            message.getBytes(Constants.CHARACTER_ENCODING));

        // Create a tree object to reference from a commit
        TreeFormatter tree = new TreeFormatter();
        tree.append("NEWBRANCH", FileMode.REGULAR_FILE, blobId);
        ObjectId treeId = odi.insert(tree);

        // Create a commit object
        CommitBuilder commit = new CommitBuilder();
        commit.setAuthor(author);
View Full Code Here

Examples of org.gradle.internal.text.TreeFormatter

    public void explain(TreeVisitor<? super String> visitor) {
        failure.explain(visitor);
    }

    private RuntimeException failure() {
        TreeFormatter formatter = new TreeFormatter();
        this.explain(formatter);
        return new GradleException(formatter.toString());
    }
View Full Code Here

Examples of org.gradle.internal.text.TreeFormatter

    public boolean isAvailable() {
        return reason == null;
    }

    public String getUnavailableMessage() {
        TreeFormatter formatter = new TreeFormatter();
        this.explain(formatter);
        return formatter.toString();
    }
View Full Code Here

Examples of org.gradle.internal.text.TreeFormatter

                visitor.endChildren();
            }
        }

        public File getTool() {
            TreeFormatter formatter = new TreeFormatter();
            explain(formatter);
            throw new GradleException(formatter.toString());
        }
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.