Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.fetch()


  private List<RefSpec> toget;

  @Override
  protected void run() throws Exception {
    Git git = new Git(db);
    FetchCommand fetch = git.fetch();
    if (fsck != null)
      fetch.setCheckFetchedObjects(fsck.booleanValue());
    if (prune != null)
      fetch.setRemoveDeletedRefs(prune.booleanValue());
    if (toget != null)
View Full Code Here


    ProgressMonitor gitMonitor = new EclipseGitProgressTransformer(monitor);
    Repository db = null;
    try {
      db = getRepository();
      Git git = new Git(db);
      FetchCommand fc = git.fetch();
      fc.setProgressMonitor(gitMonitor);

      RemoteConfig remoteConfig = new RemoteConfig(git.getRepository().getConfig(), remote);
      credentials.setUri(remoteConfig.getURIs().get(0));
      if (this.cookie != null) {
View Full Code Here

                    // This is done because checking out a tag might not happen on the current branch
                    // but create a 'detached HEAD'.
                    // In fact, a tag in git may be in multiple branches. This occurs if
                    // you create a branch after the tag has been created
                    getLogger().debug( "fetch..." );
                    git.fetch().setCredentialsProvider( credentials ).setProgressMonitor( monitor ).call();
                }
                else
                {
                    getLogger().debug( "pull..." );
                    git.pull().setCredentialsProvider( credentials ).setProgressMonitor( monitor ).call();
View Full Code Here

            logger.info("Fetching '{}' repository at path: '{}'", context.getName(), context.getProjectPath());

            Git git = new Git(repository);

            FetchResult fetchResult = git.fetch()
                .setProgressMonitor(new LoggingProgressMonitor(logger))
                .call();

            Collection<Ref> refs = FluentIterable
                .from(fetchResult.getTrackingRefUpdates())
View Full Code Here

        configToUse.addFetchRefSpec(new RefSpec(fetchRefSpec));
      configToUse.update(repository.getConfig());
      repository.getConfig().save();
      Git git = new Git(repository);
      try {
        git.fetch().setRemote(remoteName).call();
      } catch (Exception e) {
        Activator.logError(NLS.bind(CoreText.ConfigureFetchAfterCloneTask_couldNotFetch, fetchRefSpec), e);
      }
    } catch (Exception e) {
      throw new CoreException(Activator.error(e.getMessage(), e));
View Full Code Here

        logger.info("Fetching '{}' repository at path: '{}'", context.getName(), context.getProjectPath());

        Git git = new Git(repository);

        FetchResult fetchResult = git.fetch()
            .setProgressMonitor(new LoggingProgressMonitor(logger))
            .call();

        Collection<Ref> refs = FluentIterable
            .from(fetchResult.getTrackingRefUpdates())
View Full Code Here

           
            String finalOriginUrl = setupOriginIfNeeded(git,gitConfig,originUrl);

            if(allowRemote && ! Strings.isNullOrEmpty(finalOriginUrl))
            {
                git.fetch().setRemote(Constants.DEFAULT_REMOTE_NAME).call();
            }

            if (!force && gfConfig.gitFlowIsInitialized())
            {
                reporter.errorText(SHORT_NAME, "git flow is already initialized and force flag is false");
View Full Code Here

                    gitConfig.setString(ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, "url", newOriginUrl);
                    gitConfig.setString(ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, "fetch", "+refs/heads/*:refs/remotes/origin/*");
                    gitConfig.save();

                    gitConfig.load();
                    git.fetch().setRemote(Constants.DEFAULT_REMOTE_NAME).call();

                }
            }

            if (!force && gfConfig.gitFlowIsInitialized())
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.