Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.RefUpdate.link()


      refUpdate.setForceUpdate(force);
      refUpdate.setRefLogMessage(refLogMessage + " to "
          + newCommit.getName(), false);
      Result updateResult;
      if (ref != null)
        updateResult = refUpdate.link(ref.getName());
      else {
        refUpdate.setNewObjectId(newCommit);
        updateResult = refUpdate.forceUpdate();
      }
View Full Code Here


            break;
          default:
            throw new JGitInternalException("Updating HEAD failed");
          }
          rup = repo.updateRef(Constants.HEAD);
          res = rup.link(headName);
          switch (res) {
          case FAST_FORWARD:
          case FORCED:
          case NO_CHANGE:
            break;
View Full Code Here

            JGitText.get().resettingHead, headName),
            ProgressMonitor.UNKNOWN);

        // update the HEAD
        RefUpdate refUpdate = repo.updateRef(Constants.HEAD, false);
        Result res = refUpdate.link(headName);
        switch (res) {
        case FAST_FORWARD:
        case FORCED:
        case NO_CHANGE:
          break;
View Full Code Here

    dco.checkout();
    walk.release();
    // update the HEAD
    RefUpdate refUpdate = db.updateRef(Constants.HEAD);
    refUpdate.setRefLogMessage("checkout: moving to " + branchName, false);
    refUpdate.link(branchName);
  }

  /**
   * Writes a number of files in the working tree. The first content specified
   * will be written into a file named '0', the second into a file named "1"
View Full Code Here

    FileUtils.mkdir(new File(getDirectory(), "branches"));

    RefUpdate head = updateRef(Constants.HEAD);
    head.disableRefLog();
    head.link(Constants.R_HEADS + Constants.MASTER);

    final boolean fileMode;
    if (getFS().supportsExecute()) {
      File tmp = File.createTempFile("try", "execute", getDirectory());
View Full Code Here

  private boolean linkHEAD(RefUpdate target) {
    try {
      RefUpdate u = refdb.newUpdate(Constants.HEAD, false);
      u.disableRefLog();
      switch (u.link(target.getName())) {
      case NEW:
      case FORCED:
      case NO_CHANGE:
        return true;
      default:
View Full Code Here

      MissingObjectException, IncorrectObjectTypeException, IOException {

    if (branch.startsWith(Constants.R_HEADS)) {
      final RefUpdate head = repo.updateRef(Constants.HEAD);
      head.disableRefLog();
      head.link(branch);
    }

    final Ref head = result.getAdvertisedRef(branch);
    if (head == null || head.getObjectId() == null)
      return; // throw exception?
View Full Code Here

      if (detach) { // Tag
        RevCommit commit = getCommit(repository, targetRef);
        head.setNewObjectId(commit.getId());
        result = head.forceUpdate();
      } else {
        result = head.link(targetRef);
      }
      switch (result) {
      case NEW:
      case FORCED:
      case NO_CHANGE:
View Full Code Here

            break;
          default:
            throw new JGitInternalException("Updating HEAD failed");
          }
          rup = repo.updateRef(Constants.HEAD);
          res = rup.link(headName);
          switch (res) {
          case FAST_FORWARD:
          case FORCED:
          case NO_CHANGE:
            break;
View Full Code Here

            JGitText.get().resettingHead, headName),
            ProgressMonitor.UNKNOWN);

        // update the HEAD
        RefUpdate refUpdate = repo.updateRef(Constants.HEAD, false);
        Result res = refUpdate.link(headName);
        switch (res) {
        case FAST_FORWARD:
        case FORCED:
        case NO_CHANGE:
          break;
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.