Package org.eclipse.jgit.lib.RepositoryCache

Examples of org.eclipse.jgit.lib.RepositoryCache.FileKey


    final File parent = dir.getParentFile();
    assertSame(db, RepositoryCache.open(FileKey.lenient(parent, db.getFS())));
  }

  public void testCacheOpen() throws Exception {
    final FileKey loc = FileKey.exact(db.getDirectory(), db.getFS());
    final Repository d2 = RepositoryCache.open(loc);
    assertNotSame(db, d2);
    assertSame(d2, RepositoryCache.open(FileKey.exact(loc.getFile(), db.getFS())));
    d2.close();
    d2.close();
  }
View Full Code Here


  }

  private AlternateHandle openAlternate(File objdir) throws IOException {
    final File parent = objdir.getParentFile();
    if (FileKey.isGitRepository(parent, fs)) {
      FileKey key = FileKey.exact(parent, fs);
      FileRepository db = (FileRepository) RepositoryCache.open(key);
      return new AlternateRepository(db);
    }

    ObjectDirectory db = new ObjectDirectory(config, objdir, null, fs);
View Full Code Here

  }

  private AlternateHandle openAlternate(File objdir) throws IOException {
    final File parent = objdir.getParentFile();
    if (FileKey.isGitRepository(parent, fs)) {
      FileKey key = FileKey.exact(parent, fs);
      FileRepository db = (FileRepository) RepositoryCache.open(key);
      return new AlternateRepository(db);
    }

    ObjectDirectory db = new ObjectDirectory(config, objdir, null, fs);
View Full Code Here

  }

  private AlternateHandle openAlternate(File objdir) throws IOException {
    final File parent = objdir.getParentFile();
    if (FileKey.isGitRepository(parent, fs)) {
      FileKey key = FileKey.exact(parent, fs);
      FileRepository db = (FileRepository) RepositoryCache.open(key);
      return new AlternateRepository(db);
    }

    ObjectDirectory db = new ObjectDirectory(config, objdir, null, fs, null);
View Full Code Here

  }

  private AlternateHandle openAlternate(File objdir) throws IOException {
    final File parent = objdir.getParentFile();
    if (FileKey.isGitRepository(parent, fs)) {
      FileKey key = FileKey.exact(parent, fs);
      FileRepository db = (FileRepository) RepositoryCache.open(key);
      return new AlternateRepository(db);
    }

    ObjectDirectory db = new ObjectDirectory(config, objdir, null, fs, null);
View Full Code Here

    if (isUnreasonableName(name)) {
      throw new RepositoryNotFoundException("Invalid name: " + name);
    }

    try {
      final FileKey loc = FileKey.lenient(gitDirOf(name), FS.DETECTED);
      return RepositoryCache.open(loc);
    } catch (IOException e1) {
      final RepositoryNotFoundException e2;
      e2 = new RepositoryNotFoundException("Cannot open repository " + name);
      e2.initCause(e1);
View Full Code Here

      throw new RepositoryNotFoundException("Invalid name: " + name);
    }

    try {
      File dir = FileKey.resolve(gitDirOf(name), FS.DETECTED);
      FileKey loc;
      if (dir != null) {
        // Already exists on disk, use the repository we found.
        //
        loc = FileKey.exact(dir, FS.DETECTED);
      } else {
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.RepositoryCache.FileKey

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.