Package org.eclipse.jgit.api

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


      CheckoutCommand checkout = git.checkout();
      checkout.setCreateBranch(createBranch);
      checkout.setName(remote);
      checkout.setForce(force);
      checkout.setUpstreamMode(mode);
      return checkout.call();
   }

   public static Ref checkout(final Git git, final Ref localRef, final boolean createBranch,
            final SetupUpstreamMode mode, final boolean force)
            throws GitAPIException
View Full Code Here


   {
      CheckoutCommand checkout = git.checkout();
      checkout.setName(Repository.shortenRefName(localRef.getName()));
      checkout.setForce(force);
      checkout.setUpstreamMode(mode);
      return checkout.call();
   }

   public static FetchResult fetch(final Git git, final String remote, final String refSpec, final int timeout,
            final boolean fsck, final boolean dryRun,
            final boolean thin,
View Full Code Here

        CheckoutCommand co = new Git(repository).checkout();
        co.setName(target);

        try {
          co.call();
        } catch (CheckoutConflictException e) {
          return;
        } catch (JGitInternalException e) {
          throw new CoreException(Activator.error(e.getMessage(), e));
        } catch (GitAPIException e) {
View Full Code Here

      if (paths.isEmpty() || paths.contains("")) //$NON-NLS-1$
        checkoutCommand.setAllPaths(true);
      else
        for (String path : paths)
          checkoutCommand.addPath(path);
      checkoutCommand.call();
    }
  }

}
View Full Code Here

    if (headRevision)
      checkoutCommand.setStartPoint(Constants.HEAD);
    for (String path : files)
      checkoutCommand.addPath(path);
    try {
      checkoutCommand.call();
    } catch (Exception e) {
      Activator.handleError(UIText.StagingView_checkoutFailed, e, true);
    }
  }
View Full Code Here

      CheckoutCommand checkout = git.checkout();
      checkout.setCreateBranch(createBranch);
      checkout.setName(remote);
      checkout.setForce(force);
      checkout.setUpstreamMode(mode);
      return checkout.call();
   }

   public static Ref checkout(final Git git, final Ref remote, final boolean createBranch,
            final SetupUpstreamMode mode, final boolean force)
            throws JGitInternalException,
View Full Code Here

   {
      CheckoutCommand checkout = git.checkout();
      checkout.setName(remote.getName());
      checkout.setForce(force);
      checkout.setUpstreamMode(mode);
      return checkout.call();
   }

   public static FetchResult fetch(final Git git, final String remote, final String refSpec, final int timeout,
            final boolean fsck, final boolean dryRun,
            final boolean thin,
View Full Code Here

    }

    try {
      checkout.setCreateBranch(createBranch).setForce(force)
          .setName(branch);
      checkout.call();
    } catch (Exception e) {
      throw new BuildException("Could not checkout repository " + src, e);
    }
  }
View Full Code Here

            if (!exists) {
                command = command.setCreateBranch(true).setForce(true).
                        setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK).
                        setStartPoint(getRemote() + "/" + branch);
        }
        Ref ref = command.call();
        if (LOG.isDebugEnabled()) {
            LOG.debug("Checked out branch " + branch + " with results " + ref.getName());
        }
        configureBranch(branch);
    }
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.