Examples of LsRemoteCommand


Examples of org.eclipse.jgit.api.LsRemoteCommand

    } catch (IOException e) {
      throw new ADCException("Error creating local file repo", e);
    }

    Git git = new Git(localRepo);
    LsRemoteCommand cmd = git.lsRemote().setRemote(repoURL);
    if (credentialsProvider != null) {
      cmd.setCredentialsProvider(credentialsProvider);
    }
    try {
      Collection<Ref> collection = cmd.call();
      List<String> refNames = new ArrayList<String>();
      if (collection != null) {
        for (Ref ref : collection) {
          if (log.isDebugEnabled()) {
            log.debug(repoURL + ": " + ref.getName());
View Full Code Here

Examples of org.eclipse.jgit.api.LsRemoteCommand

        try
        {
            git = Git.open( fileSet.getBasedir() );
            CredentialsProvider credentials = JGitUtils.getCredentials( repo );

            LsRemoteCommand lsCommand =
                git.lsRemote().setRemote( repo.getPushUrl() ).setCredentialsProvider( credentials );

            Map<String, String> tag = new HashMap<String, String>();
            Collection<Ref> allTags = lsCommand.setHeads( false ).setTags( true ).call();
            for ( Ref ref : allTags )
            {
                tag.put( Repository.shortenRefName( ref.getName() ), ref.getObjectId().name() );
            }

            Map<String, String> heads = new HashMap<String, String>();
            Collection<Ref> allHeads = lsCommand.setHeads( true ).setTags( false ).call();
            for ( Ref ref : allHeads )
            {
                heads.put( Repository.shortenRefName( ref.getName() ), ref.getObjectId().name() );
            }
View Full Code Here

Examples of org.eclipse.jgit.api.LsRemoteCommand

    if (remote == null)
      throw new IllegalArgumentException(Assert.formatNotNull("Remote"));
    if (remote.length() == 0)
      throw new IllegalArgumentException(Assert.formatNotEmpty("Remote"));

    final LsRemoteCommand lsRemote = new LsRemoteCommand(repository);
    lsRemote.setRemote(remote);
    try {
      final Collection<Ref> remoteRefs = lsRemote.call();
      final List<RefDiff> diffs = new ArrayList<RefDiff>();
      if (hasRemote(repository, remote)) {
        final String refPrefix = R_REMOTES + remote + "/";
        for (Ref remoteRef : remoteRefs) {
          String name = remoteRef.getName();
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.