Package org.eclipse.jgit.lib

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


        .getRepository();
    assertNotNull(subRepo);

    RefUpdate update = subRepo.updateRef(Constants.HEAD, true);
    update.setNewObjectId(id);
    update.forceUpdate();

    SubmoduleStatusCommand command = new SubmoduleStatusCommand(db);
    Map<String, SubmoduleStatus> statuses = command.call();
    assertNotNull(statuses);
    assertEquals(1, statuses.size());
View Full Code Here


    assertNotNull(subRepo);

    RefUpdate update = subRepo.updateRef(Constants.HEAD, true);
    update.setNewObjectId(ObjectId
        .fromString("aaaa0000aaaa0000aaaa0000aaaa0000aaaa0000"));
    update.forceUpdate();

    SubmoduleStatusCommand command = new SubmoduleStatusCommand(db);
    Map<String, SubmoduleStatus> statuses = command.call();
    assertNotNull(statuses);
    assertEquals(1, statuses.size());
View Full Code Here

        .setOnly(path).call();
    assertNotNull(submoduleAddCommit);

    RefUpdate update = repo.updateRef(Constants.HEAD);
    update.setNewObjectId(commit);
    assertEquals(Result.FORCED, update.forceUpdate());

    RevCommit submoduleEditCommit = git.commit()
        .setMessage("submodule add").setOnly(path).call();
    assertNotNull(submoduleEditCommit);
    TreeWalk walk = new TreeWalk(db);
View Full Code Here

    refUpdate.setRefLogMessage(refLogMessage, false);
    if (currentRef != null)
      refUpdate.setExpectedOldObjectId(currentRef.getObjectId());
    else
      refUpdate.setExpectedOldObjectId(ObjectId.zeroId());
    refUpdate.forceUpdate();
  }

  private RebaseResult processStep(RebaseTodoLine step, boolean shouldPick)
      throws IOException, GitAPIException {
    if (Action.COMMENT.equals(step.getAction()))
View Full Code Here

    if (headName.startsWith(Constants.R_REFS)) {
      RefUpdate rup = repo.updateRef(headName);
      rup.setNewObjectId(aNewHead);
      rup.setRefLogMessage("rebase finished: " + headName + " onto " //$NON-NLS-1$ //$NON-NLS-2$
          + onto.getName(), false);
      Result res = rup.forceUpdate();
      switch (res) {
      case FAST_FORWARD:
      case FORCED:
      case NO_CHANGE:
        break;
View Full Code Here

      if (headName.startsWith(Constants.R_REFS)) {
        // update the HEAD
        res = refUpdate.link(headName);
      } else {
        refUpdate.setNewObjectId(repo.readOrigHead());
        res = refUpdate.forceUpdate();

      }
      switch (res) {
      case FAST_FORWARD:
      case FORCED:
View Full Code Here

      refUpdate.setNewObjectId(commit);
      refUpdate.setRefLogMessage(
          "checkout: moving from " //$NON-NLS-1$
              + Repository.shortenRefName(headName)
              + " to " + commit.getName(), false); //$NON-NLS-1$
      Result res = refUpdate.forceUpdate();
      switch (res) {
      case FAST_FORWARD:
      case NO_CHANGE:
      case FORCED:
        break;
View Full Code Here

  public void testListRemote_Dumb_DetachedHEAD() throws Exception {
    Repository src = remoteRepository.getRepository();
    RefUpdate u = src.updateRef(Constants.HEAD, true);
    RevCommit Q = remoteRepository.commit().message("Q").create();
    u.setNewObjectId(Q);
    assertEquals(RefUpdate.Result.FORCED, u.forceUpdate());

    Repository dst = createBareRepository();
    Ref head;
    Transport t = Transport.open(dst, dumbAuthNoneURI);
    try {
View Full Code Here

  public void testListRemote_Smart_DetachedHEAD() throws Exception {
    Repository src = remoteRepository.getRepository();
    RefUpdate u = src.updateRef(Constants.HEAD, true);
    RevCommit Q = remoteRepository.commit().message("Q").create();
    u.setNewObjectId(Q);
    assertEquals(RefUpdate.Result.FORCED, u.forceUpdate());

    Repository dst = createBareRepository();
    Ref head;
    Transport t = Transport.open(dst, smartAuthNoneURI);
    try {
View Full Code Here

  private void update(RevCommit rev) throws Exception {
    RefUpdate u = db.updateRef(GitRepositoryManager.REF_CONFIG);
    u.disableRefLog();
    u.setNewObjectId(rev);
    switch (u.forceUpdate()) {
      case FAST_FORWARD:
      case FORCED:
      case NEW:
      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.