Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileRepository


   * @throws Exception
   */
  @Test
  public void diffWithNoParents() throws Exception {
    RevCommit commit = add("test.txt", "content");
    Repository repo = new FileRepository(testRepo);
    TreeWalk walk = TreeUtils.diffWithParents(repo, Constants.HEAD);
    assertNotNull(walk);
    assertEquals(2, walk.getTreeCount());
    assertTrue(walk.next());
    assertEquals("test.txt", walk.getPathString());
View Full Code Here


   *
   * @throws Exception
   */
  @Test
  public void diffWithOneParent() throws Exception {
    Repository repo = new FileRepository(testRepo);
    RevCommit commit1 = add("test.txt", "content");
    RevCommit commit2 = add("test.txt", "content2");
    TreeWalk walk = TreeUtils.diffWithParents(repo, Constants.HEAD);
    assertNotNull(walk);
    assertEquals(2, walk.getTreeCount());
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void diffRevisions() throws Exception {
    Repository repo = new FileRepository(testRepo);
    RevCommit commit1 = add("test.txt", "content");
    RevCommit commit2 = add("test.txt", "content2");
    TreeWalk walk = TreeUtils.diffWithCommits(repo,
        Constants.MASTER + "~1", Constants.MASTER);
    assertNotNull(walk);
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void diffCommits() throws Exception {
    Repository repo = new FileRepository(testRepo);
    RevCommit commit1 = add("test.txt", "content");
    RevCommit commit2 = add("test.txt", "content2");
    TreeWalk walk = TreeUtils.diffWithCommits(repo, commit1, commit2);
    assertNotNull(walk);
    assertEquals(2, walk.getTreeCount());
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withCommitsNullIds() throws IOException {
    TreeUtils.withCommits(new FileRepository(testRepo), (ObjectId[]) null);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withCommitsNullRevision() throws IOException {
    TreeUtils.withCommits(new FileRepository(testRepo), (String[]) null);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withCommitsEmptyRevision() throws IOException {
    TreeUtils.withCommits(new FileRepository(testRepo), new String[0]);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withCommitsEmptyCommits() throws IOException {
    TreeUtils.withCommits(new FileRepository(testRepo), new ObjectId[0]);
  }
View Full Code Here

   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdNullCommitId() throws IOException {
    TreeUtils
        .getId(new FileRepository(testRepo), (ObjectId) null, "folder");
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdNullRevision() throws IOException {
    TreeUtils.getId(new FileRepository(testRepo), (String) null, "folder");
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.FileRepository

Copyright © 2018 www.massapicom. 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.