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()

    final RevCommit commit = parseCommit(repo, head);

    boolean detached = !head.getName().startsWith(Constants.R_HEADS);
    RefUpdate u = repo.updateRef(Constants.HEAD, detached);
    u.setNewObjectId(commit.getId());
    u.forceUpdate();

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

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

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

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

    }

    try {
      RefUpdate refUpdate = repository.updateRef(branchName, false);
      refUpdate.setNewObjectId(ObjectId.fromString(commitId));
      RefUpdate.Result result = refUpdate.forceUpdate();

      switch (result) {
      case NEW:
      case FORCED:
      case NO_CHANGE:
View Full Code Here

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

            branchName = "refs/heads/" + branchName;
          }
          RefUpdate ru = repository.updateRef(branchName);
          ru.setNewObjectId(commitId);
          ru.setRefLogMessage("commit: " + revCommit.getShortMessage(), false);
          Result rc = ru.forceUpdate();
          switch (rc) {
          case NEW:
          case FORCED:
          case FAST_FORWARD:
            success = true;
View Full Code Here

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

        RevCommit revCommit = revWalk.parseCommit(commitId);
        RefUpdate ru = db.updateRef(BRANCH);
        ru.setNewObjectId(commitId);
        ru.setExpectedOldObjectId(headId);
        ru.setRefLogMessage("commit: " + revCommit.getShortMessage(), false);
        Result rc = ru.forceUpdate();
        switch (rc) {
        case NEW:
        case FORCED:
        case FAST_FORWARD:
          success = true;
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

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()

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

      switch (mode) {
        case HARD:
View Full Code Here

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

    final RevCommit commit = parseCommit(repo, head);

    boolean detached = !head.getName().startsWith(Constants.R_HEADS);
    RefUpdate u = repo.updateRef(Constants.HEAD, detached);
    u.setNewObjectId(commit.getId());
    u.forceUpdate();

    if (!bare) {
      DirCache dc = repo.lockDirCache();
      DirCacheCheckout co = new DirCacheCheckout(repo, dc,
          commit.getTree());
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.