/** * Construct a representation of a Git repository. * <p> * The work tree, object directory, alternate object directories and index * file locations are deduced from the given git directory and the default * rules by running * {@link org.eclipse.jgit.storage.file.FileRepositoryBuilder}. This * constructor is the same as saying: * * <pre> * new FileRepositoryBuilder().setGitDir(gitDir).build() * </pre> * * @param gitDir * GIT_DIR (the location of the repository metadata). * @throws java.io.IOException * the repository appears to already exist but cannot be * accessed. * @see FileRepositoryBuilder */ public FileRepository(File gitDir) throws IOException { this(new FileRepositoryBuilder().setGitDir(gitDir).setup()); }
/** * {@inheritDoc} * <p> * Create a repository matching the configuration in this builder. * <p> * If an option was not set, the build method will try to default the option * based on other options. If insufficient information is available, an * exception is thrown to the caller. * * @since 3.0 */ @Override public Repository build() throws IOException { FileRepository repo = new FileRepository(setup()); if (isMustExist() && !repo.getObjectDatabase().exists()) throw new RepositoryNotFoundException(getGitDir()); return repo; }
/** * Construct a representation of a Git repository. * <p> * The work tree, object directory, alternate object directories and index * file locations are deduced from the given git directory and the default * rules by running {@link FileRepositoryBuilder}. This constructor is the * same as saying: * * <pre> * new FileRepositoryBuilder().setGitDir(gitDir).build() * </pre> * * @param gitDir * GIT_DIR (the location of the repository metadata). * @throws IOException * the repository appears to already exist but cannot be * accessed. * @see FileRepositoryBuilder */ public FileRepository(final File gitDir) throws IOException { this(new FileRepositoryBuilder().setGitDir(gitDir).setup()); }
/** * Construct a representation of a Git repository. * <p> * The work tree, object directory, alternate object directories and index * file locations are deduced from the given git directory and the default * rules by running * {@link org.eclipse.jgit.storage.file.FileRepositoryBuilder}. This * constructor is the same as saying: * * <pre> * new FileRepositoryBuilder().setGitDir(gitDir).build() * </pre> * * @param gitDir * GIT_DIR (the location of the repository metadata). * @throws java.io.IOException * the repository appears to already exist but cannot be * accessed. * @see FileRepositoryBuilder */ public FileRepository(File gitDir) throws IOException { this(new FileRepositoryBuilder().setGitDir(gitDir).setup()); }
/** * {@inheritDoc} * <p> * Create a repository matching the configuration in this builder. * <p> * If an option was not set, the build method will try to default the option * based on other options. If insufficient information is available, an * exception is thrown to the caller. * * @since 3.0 */ @Override public Repository build() throws IOException { FileRepository repo = new FileRepository(setup()); if (isMustExist() && !repo.getObjectDatabase().exists()) throw new RepositoryNotFoundException(getGitDir()); return repo; }
/** * Create a repository matching the configuration in this builder. * <p> * If an option was not set, the build method will try to default the option * based on other options. If insufficient information is available, an * exception is thrown to the caller. * * @return a repository matching this configuration. * @throws IllegalArgumentException * insufficient parameters were set. * @throws IOException * the repository could not be accessed to configure the rest of * the builder's parameters. * @since 3.0 */ @Override public Repository build() throws IOException { FileRepository repo = new FileRepository(setup()); if (isMustExist() && !repo.getObjectDatabase().exists()) throw new RepositoryNotFoundException(getGitDir()); return repo; }
repository = new FileRepositoryBuilder().setWorkTree(baseDir).setGitDir(gitDir).setup().build(); } catch (IOException ex) { throw ServerLogger.ROOT_LOGGER.failedToPullRepository(ex, gitConfig.getRepository()); repository = new FileRepositoryBuilder().setWorkTree(baseDir).setGitDir(gitDir).setup().build();
repository = new FileRepositoryBuilder().setWorkTree(baseDir).setGitDir(gitDir).setup().build(); } catch (IOException ex) { throw ServerLogger.ROOT_LOGGER.failedToPullRepository(ex, gitConfig.getRepository()); repository = new FileRepositoryBuilder().setWorkTree(baseDir).setGitDir(gitDir).setup().build();