Examples of forceUpdate()


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

      dco.checkout();
      // update the HEAD
      RefUpdate refUpdate = repo.updateRef(Constants.HEAD, true);
      refUpdate.setExpectedOldObjectId(head);
      refUpdate.setNewObjectId(commit);
      Result res = refUpdate.forceUpdate();
      switch (res) {
      case FAST_FORWARD:
      case NO_CHANGE:
      case FORCED:
        break;
View Full Code Here

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

      commit.setMessage("test\n");
      ObjectId commitId = oi.insert(commit);

      final RefUpdate ref = repository.updateRef(Constants.HEAD);
      ref.setNewObjectId(commitId);
      switch (ref.forceUpdate()) {
        case NEW:
        case FAST_FORWARD:
        case FORCED:
        case NO_CHANGE:
          break;
View Full Code Here

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

    }

    RefUpdate update = repo.updateRef(refName);
    update.setNewObjectId(treeId);
    update.disableRefLog();
    update.forceUpdate();
    return rw.parseTree(treeId);
  }

  private static ObjectId emptyTree(final Repository repo) throws IOException {
    ObjectInserter oi = repo.newObjectInserter();
View Full Code Here

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

    }

    final RevCommit commit = parseCommit(branch);
    final RefUpdate u = db.updateRef(Constants.HEAD);
    u.setNewObjectId(commit);
    u.forceUpdate();

    DirCache dc = db.lockDirCache();
    DirCacheCheckout co = new DirCacheCheckout(db, dc, commit.getTree());
    co.checkout();
  }
View Full Code Here

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

      ru.setNewObjectId(commitId);

      String refName = Repository.shortenRefName(ref);
      String message = refName + ": updating " + Constants.HEAD; //$NON-NLS-1$
      ru.setRefLogMessage(message, false);
      if (ru.forceUpdate() == RefUpdate.Result.LOCK_FAILURE)
        throw new JGitInternalException(MessageFormat.format(
            JGitText.get().cannotLock, ru.getName()));

      ObjectId origHead = ru.getOldObjectId();
      if (origHead != null)
View Full Code Here

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

      RefUpdate updateRef = repo.updateRef(Constants.R_HEADS + name);
      updateRef.setNewObjectId(startAt);
      updateRef.setRefLogMessage(refLogMessage, false);
      Result updateResult;
      if (exists && force)
        updateResult = updateRef.forceUpdate();
      else
        updateResult = updateRef.update();

      setCallable(false);
View Full Code Here

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

      Result updateResult;
      if (ref != null)
        updateResult = refUpdate.link(ref.getName());
      else {
        refUpdate.setNewObjectId(newCommit);
        updateResult = refUpdate.forceUpdate();
      }

      setCallable(false);

      boolean ok = false;
View Full Code Here

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

      RefUpdate updateRef = repo.updateRef(Constants.R_HEADS + name);
      updateRef.setNewObjectId(startAt);
      updateRef.setRefLogMessage(refLogMessage, false);
      Result updateResult;
      if (exists && force)
        updateResult = updateRef.forceUpdate();
      else
        updateResult = updateRef.update();

      setCallable(false);
View Full Code Here

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

      Result updateResult;
      if (ref != null)
        updateResult = refUpdate.link(ref.getName());
      else {
        refUpdate.setNewObjectId(newCommit);
        updateResult = refUpdate.forceUpdate();
      }

      setCallable(false);

      boolean ok = false;
View Full Code Here

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

        // point the previous head (if any) to the new commit
        String headName = readFile(rebaseDir, HEAD_NAME);
        if (headName.startsWith(Constants.R_REFS)) {
          RefUpdate rup = repo.updateRef(headName);
          rup.setNewObjectId(newHead);
          Result res = rup.forceUpdate();
          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.