Package org.eclipse.jgit.storage.file

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


   * @throws Exception
   */
  @Test
  public void latest() throws Exception {
    RevCommit commit = add("file.txt", "content");
    assertEquals(commit, CommitUtils.getHead(new FileRepository(testRepo)));
    assertEquals(commit,
        CommitUtils.getMaster(new FileRepository(testRepo)));
  }
View Full Code Here


   * Test retrieving latest commit from repository
   *
   * @throws Exception
   */
  public void latestOnEmptyRepository() throws Exception {
    assertNull(CommitUtils.getHead(new FileRepository(testRepo)));
  }
View Full Code Here

   */
  @Test
  public void byId() throws Exception {
    RevCommit commit = add("file.txt", "content");
    assertEquals(commit,
        CommitUtils.getCommit(new FileRepository(testRepo), commit));
  }
View Full Code Here

  @Test
  public void tagRef() throws Exception {
    add("a.txt", "a");
    RevCommit commit = add("test.txt", "content");
    tag(testRepo, "tag1");
    Repository repo = new FileRepository(testRepo);
    RevCommit refCommit = CommitUtils.getRef(repo, "tag1");
    assertNotNull(refCommit);
    assertEquals(commit, refCommit);
    Collection<RevCommit> commits = CommitUtils.getTags(repo);
    assertNotNull(commits);
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void invalidRef() throws Exception {
    RevCommit commit = CommitUtils.getRef(new FileRepository(testRepo),
        "notatag");
    assertNull(commit);
  }
View Full Code Here

  @Test
  public void branchRef() throws Exception {
    add("a.txt", "a");
    RevCommit commit = add("test.txt", "content");
    Ref ref = branch(testRepo, "branch1");
    Repository repo = new FileRepository(testRepo);
    RevCommit refCommit = CommitUtils.getRef(repo, ref);
    assertNotNull(refCommit);
    assertEquals(commit, refCommit);
    Collection<RevCommit> commits = CommitUtils.getBranches(repo);
    assertNotNull(commits);
View Full Code Here

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

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

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

   *
   * @throws Exception
   */
  @Test(expected = IllegalArgumentException.class)
  public void getBaseWithNullIds() throws Exception {
    CommitUtils.getBase(new FileRepository(testRepo), (ObjectId[]) null);
  }
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.