Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.CloneCommand.call()


    CloneCommand clone = Git.cloneRepository();
    clone.setURI(MessageFormat.format("{0}/working/jgit", url));
    clone.setDirectory(jgit2Folder);
    clone.setBare(false);
    clone.setCloneAllBranches(true);
    GitBlitSuite.close(clone.call());
    assertTrue(true);

    Git git = Git.open(jgit2Folder);
    File file = new File(jgit2Folder, "NONBARE");
    OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true), Constants.CHARSET);
View Full Code Here


    clone.setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password));
    clone.setURI(MessageFormat.format("{0}/ticgit.git", url));
    clone.setDirectory(ticgitFolder);
    clone.setBare(false);
    clone.setCloneAllBranches(true);
    Git git = clone.call();
    List<RevCommit> commits = JGitUtils.getRevLog(git.getRepository(), 10);
    GitBlitSuite.close(git);
    assertEquals(10, commits.size());

    // restore anonymous repository access
View Full Code Here

      try
      {
         CloneCommand cloneCommand = Git.cloneRepository().setURI(uri.getValue())
                  .setDirectory(cloneFolder.getUnderlyingResourceObject());
         cloneCommand.setProgressMonitor(new ProgressMonitorAdapter(context.getProgressMonitor()));
         clone = cloneCommand.call();
      }
      finally
      {
         gitUtils.close(clone);
      }
View Full Code Here

              ((TransportHttp) t).setAdditionalHeaders(map);
            }
          }
        });
      }
      Git git = cc.call();

      if (monitor.isCanceled()) {
        return new Status(IStatus.CANCEL, GitActivator.PI_GIT, "Cancelled");
      }
      // Configure the clone, see Bug 337820
View Full Code Here

                CredentialsProvider credentials = JGitUtils.getCredentials( (GitScmProviderRepository) repo );
                getLogger().info( "cloning [" + branch + "] to " + fileSet.getBasedir() );
                CloneCommand command = Git.cloneRepository().setURI( repository.getFetchUrl() );
                command.setCredentialsProvider( credentials ).setBranch( branch ).setDirectory( fileSet.getBasedir() );
                command.setProgressMonitor( monitor );
                git = command.call();
            }

            JGitRemoteInfoCommand remoteInfoCommand = new JGitRemoteInfoCommand();
            remoteInfoCommand.setLogger( getLogger() );
            RemoteInfoScmResult result = remoteInfoCommand.executeRemoteInfoCommand( repository, fileSet, null );
View Full Code Here

   @Override
   public Git clone(final DirectoryResource dir, final String repoUri) throws GitAPIException
   {
      CloneCommand clone = Git.cloneRepository().setURI(repoUri)
               .setDirectory(dir.getUnderlyingResourceObject());
      Git git = clone.call();
      return git;
   }

   @Override
   public Git git(final DirectoryResource dir) throws IOException
View Full Code Here

   @Override
   public Git clone(final DirectoryResource dir, final String repoUri) throws GitAPIException
   {
      CloneCommand clone = Git.cloneRepository().setURI(repoUri)
               .setDirectory(dir.getUnderlyingResourceObject());
      Git git = clone.call();
      return git;
   }

   @Override
   public Git git(final DirectoryResource dir) throws IOException
View Full Code Here

{
   public static Git clone(final DirectoryResource dir, final String repoUri) throws GitAPIException
   {
      CloneCommand clone = Git.cloneRepository().setURI(repoUri)
               .setDirectory(dir.getUnderlyingResourceObject());
      Git git = clone.call();
      return git;
   }

   public static Git git(final DirectoryResource dir) throws IOException
   {
View Full Code Here

        List<String> branches = new ArrayList<String>();
        for (Ref branch : selectedBranches)
          branches.add(branch.getName());
        cloneRepository.setBranchesToClone(branches);
      }
      Git git = cloneRepository.call();
      repository = git.getRepository();
      synchronized (this) {
        if (postCloneTasks != null)
          for (PostCloneTask task : postCloneTasks)
            task.execute(git.getRepository(), monitor);
View Full Code Here

        // initial clone
        CloneCommand clone = Git.cloneRepository();
        clone.setURI(new URL(j.getURL(), "workflowLibs.git").toExternalForm());
        File dir = tmp.newFolder();
        clone.setDirectory(dir);
        Git git = clone.call();

        // makes sure there's nothing in here
        Collection<Ref> remotes = git.lsRemote().setRemote("origin").call();
        assertEquals(0,remotes.size());
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.