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 JGitInternalException,
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

    }

    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

      command.setName(name);
      command.setForce(force);
    }
    try {
      String oldBranch = db.getBranch();
      Ref ref = command.call();
      if (ref == null)
        return;
      if (Repository.shortenRefName(ref.getName()).equals(oldBranch)) {
        outw.println(MessageFormat.format(
            CLIText.get().alreadyOnBranch,
View Full Code Here

    writeTrashFile("file.txt", "b");

    // Switch branches
    CheckoutCommand checkout = git.checkout().setName("b1");
    try {
      checkout.call();
      fail("Checkout exception not thrown");
    } catch (org.eclipse.jgit.api.errors.CheckoutConflictException e) {
      CheckoutResult result = checkout.getResult();
      assertNotNull(result);
      assertNotNull(result.getConflictList());
View Full Code Here

            String p = paths.getString(i);
            if (removeUntracked && !isInIndex(git.getRepository(), p))
              toRemove.add(p);
            checkout.addPath(p);
          }
          checkout.call();
          for (String p : toRemove) {
            File f = new File(git.getRepository().getWorkTree(), p);
            f.delete();
          }
          return true;
View Full Code Here

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

   @Override
   public Ref checkout(final Git git, final Ref localRef, 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();
   }

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

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

   @Override
   public Ref checkout(final Git git, final Ref localRef, 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();
   }

   @Override
   public FetchResult fetch(final Git git, final String remote, final String refSpec, final int timeout,
            final boolean fsck, final boolean dryRun,
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.