Package org.eclipse.jgit.storage.file

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


   *
   * @throws Exception
   */
  @Test(expected = GitException.class)
  public void getCommitWithZeroId() throws Exception {
    CommitUtils.getCommit(new FileRepository(testRepo), ObjectId.zeroId());
  }
View Full Code Here


   */
  @Test
  public void getLastCommit() throws Exception {
    RevCommit commit1 = add("file1.txt", "content1");
    RevCommit commit2 = add("file2.txt", "content2");
    assertEquals(commit1, CommitUtils.getLastCommit(new FileRepository(
        testRepo), "file1.txt"));
    assertEquals(commit2, CommitUtils.getLastCommit(new FileRepository(
        testRepo), "file2.txt"));
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test(expected = IllegalArgumentException.class)
  public void getLastCommitNullPath() throws Exception {
    CommitUtils.getLastCommit(new FileRepository(testRepo), null);
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test(expected = IllegalArgumentException.class)
  public void getLastCommitEmptyPath() throws Exception {
    CommitUtils.getLastCommit(new FileRepository(testRepo), "");
  }
View Full Code Here

   * @throws Exception
   */
  @Test(expected = IllegalArgumentException.class)
  public void getLastCommitNullRevision() throws Exception {
    CommitUtils
        .getLastCommit(new FileRepository(testRepo), null, "d/f.txt");
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test(expected = IllegalArgumentException.class)
  public void getLastCommitEmptyRevision() throws Exception {
    CommitUtils.getLastCommit(new FileRepository(testRepo), "", "d/f.txt");
  }
View Full Code Here

        repo.set(repository);
        return super.setRepository(repository);
      }
    };
    CommitTreeFilter filter = new CommitTreeFilter(treeFilter);
    Repository fileRepo = new FileRepository(testRepo);
    filter.setRepository(fileRepo);
    assertNotNull(repo.get());
    assertEquals(fileRepo.getDirectory(), repo.get().getDirectory());
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test(expected = IllegalArgumentException.class)
  public void getContentNullObjectId() throws Exception {
    BlobUtils.getContent(new FileRepository(testRepo), null);
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test(expected = GitException.class)
  public void badObjectLoader() throws Exception {
    BlobUtils.getContent(new FileRepository(testRepo), ObjectId.zeroId());
  }
View Full Code Here

    };
    new CommitFinder(testRepo).setFilter(diffs).find();
    assertNotNull(blob.get());

    Repository repo = new FileRepository(testRepo) {

      public ObjectLoader open(AnyObjectId objectId, int typeHint)
          throws MissingObjectException,
          IncorrectObjectTypeException, IOException {
        final ObjectLoader loader = super.open(objectId, typeHint);
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.