Examples of forceUpdate()


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.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 = repository.updateRef(GB_REFLOG);
          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()

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

    RevCommit commit2 = add(repo2, "test2.txt", "content2.txt");
    Repository repo = new FileRepository(testRepo);
    RefUpdate originMaster = repo.updateRef(Constants.R_REMOTES
        + Constants.DEFAULT_REMOTE_NAME + "/" + Constants.MASTER);
    originMaster.setNewObjectId(commit1);
    originMaster.forceUpdate();
    RemoteConfig config = new RemoteConfig(repo.getConfig(),
        Constants.DEFAULT_REMOTE_NAME);
    config.addURI(new URIish(repo2.toURI().toString()));
    config.update(repo.getConfig());
    Collection<RefDiff> diffs = RepositoryUtils.diffOriginRefs(repo);
View Full Code Here

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

    // update the HEAD
    RefUpdate refUpdate = db.updateRef(Constants.HEAD, true);
    refUpdate.setNewObjectId(commit);
    refUpdate.setRefLogMessage("checkout: moving to " + head.getName(),
        false);
    refUpdate.forceUpdate();
  }

  @Test
  public void testFastForwardWithNewFile() throws Exception {
    // create file1 on master
View Full Code Here

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

    remoteGit.add().addFilepattern("Test.txt").call();
    secondCommit = remoteGit.commit().setMessage("Second commit").call();
    // create a master branch
    RefUpdate rup = remoteRepository.updateRef("refs/heads/master");
    rup.setNewObjectId(initialCommit.getId());
    rup.forceUpdate();

    Repository localRepository = createWorkRepository();
    Git localGit = new Git(localRepository);
    StoredConfig config = localRepository.getConfig();
    RemoteConfig rc = new RemoteConfig(config, "origin");
View Full Code Here

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

    config.save();
    FetchResult res = localGit.fetch().setRemote("origin").call();
    assertFalse(res.getTrackingRefUpdates().isEmpty());
    rup = localRepository.updateRef("refs/heads/master");
    rup.setNewObjectId(initialCommit.getId());
    rup.forceUpdate();
    rup = localRepository.updateRef(Constants.HEAD);
    rup.link("refs/heads/master");
    rup.setNewObjectId(initialCommit.getId());
    rup.update();
    return localGit;
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.