Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileRepository.resolve()


                "Invalid repository directory provided: " + repoDirectory.getAbsolutePath());
        // open repo, jgit has some problems with not canonical paths
        File canonicalRepo = repoDirectory.getCanonicalFile();
        FileRepository repo = new FileRepositoryBuilder().findGitDir(canonicalRepo).build();
        // extract HEAD revision
        ObjectId revisionObject = repo.resolve(Constants.HEAD);
        if (null == revisionObject) throw new IOException("Cannot read current revision from repository: " + repo);
        String revision = revisionObject.name();
        // extract current branch
        String branch = readCurrentBranch(repo, revision);
        // extract current tag
View Full Code Here


    assertFalse(new File(db.getDirectory(), "logs/refs/heads/b").exists());

    // Create new Repository instance, to reread caches and make sure our
    // assumptions are persistent.
    Repository ndb = new FileRepository(db.getDirectory());
    assertEquals(rb2, ndb.resolve("refs/heads/new/name"));
    assertNull(ndb.resolve("refs/heads/b"));
  }

  public void tryRenameWhenLocked(String toLock, String fromName,
      String toName, String headPointsTo) throws IOException {
View Full Code Here

    // Create new Repository instance, to reread caches and make sure our
    // assumptions are persistent.
    Repository ndb = new FileRepository(db.getDirectory());
    assertEquals(rb2, ndb.resolve("refs/heads/new/name"));
    assertNull(ndb.resolve("refs/heads/b"));
  }

  public void tryRenameWhenLocked(String toLock, String fromName,
      String toName, String headPointsTo) throws IOException {
    // setup
View Full Code Here

        final FileRepository repository = new FileRepositoryBuilder()
                .readEnvironment()
                .findGitDir(sourceDirectory)
                .build();

        ObjectId head = repository.resolve("HEAD");

        if (fetched.containsKey(head))
            return fetched.get(head);

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.