Package org.eclipse.jgit.storage.file

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


    public static BuildNumber extract(File repoDirectory) throws IOException {
        if(!(repoDirectory.exists() && repoDirectory.isDirectory())) throw new IOException(
                "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


   *             the repository could not be accessed to configure the rest of
   *             the builder's parameters.
   */
  @SuppressWarnings("unchecked")
  public R build() throws IOException {
    return (R) new FileRepository(setup());
  }
View Full Code Here

    InternalLocalFetchConnection() throws TransportException {
      super(TransportLocal.this);

      final Repository dst;
      try {
        dst = new FileRepository(remoteGitDir);
      } catch (IOException err) {
        throw new TransportException(uri, JGitText.get().notAGitDirectory);
      }

      final PipedInputStream in_r;
View Full Code Here

    InternalLocalPushConnection() throws TransportException {
      super(TransportLocal.this);

      final Repository dst;
      try {
        dst = new FileRepository(remoteGitDir);
      } catch (IOException err) {
        throw new TransportException(uri, JGitText.get().notAGitDirectory);
      }

      final PipedInputStream in_r;
View Full Code Here

    }

    public Repository open(final boolean mustExist) throws IOException {
      if (mustExist && !isGitRepository(path, fs))
        throw new RepositoryNotFoundException(path);
      return new FileRepository(path);
    }
View Full Code Here

                                              new UsernamePasswordCredentialsProvider(
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_USERNAME),
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_PASSWORD).toCharArray());
    // Clone
    // --------------------------
    FileRepository localRepo = null;
    try {
      localRepo = new FileRepository(new File(parentDirName + "/.git"));
    } catch (IOException e) {
      log.error("Exception occurred in creating a new file repository. Reason: " + e.getMessage());
      throw e;
    }
View Full Code Here

          gitRepoCtx.setKeyBasedAuthentication(false);
    } catch (Exception e1) {
      log.error("Exception occurred.. " + e1.getMessage(), e1);
    }

        FileRepository localRepo = null;
        try {
            // localRepo = new FileRepository(new File(gitLocalRepoPath + "/.git"));
            // Fixing STRATOS-380
            localRepo = new FileRepository(new File(gitRepoCtx.getGitLocalRepoPath() + "/.git"));

        } catch (IOException e) {
            e.printStackTrace();
        }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withParentsNullId() throws IOException {
    TreeUtils.withParents(new FileRepository(testRepo), (ObjectId) null);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withParentsNullRevision() throws IOException {
    TreeUtils.withParents(new FileRepository(testRepo), (String) null);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void withParentsEmptyRevision() throws IOException {
    TreeUtils.withParents(new FileRepository(testRepo), "");
  }
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.