Examples of updateRef()


Examples of org.eclipse.jgit.lib.Repository.updateRef()

    initialCommit = remoteGit.commit().setMessage("Initial commit").call();
    writeTrashFile("Test.txt", "Some change");
    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);
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

    rc.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/origin/*"));
    rc.update(config);
    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());
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

    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

Examples of org.eclipse.jgit.lib.Repository.updateRef()

            DirCacheCheckout co = new DirCacheCheckout(
                submoduleRepo, submoduleRepo.lockDirCache(),
                commit.getTree());
            co.setFailOnConflict(true);
            co.checkout();
            RefUpdate refUpdate = submoduleRepo.updateRef(
                Constants.HEAD, true);
            refUpdate.setNewObjectId(commit);
            refUpdate.forceUpdate();
          }
        } finally {
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

    Repository subRepo = Git.init().setBare(false)
        .setDirectory(new File(db.getWorkTree(), path)).call()
        .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();
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

    Repository subRepo = Git.init().setBare(false)
        .setDirectory(new File(db.getWorkTree(), path)).call()
        .getRepository();
    assertNotNull(subRepo);

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

    SubmoduleStatusCommand command = new SubmoduleStatusCommand(db);
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

  }

  @Test
  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();
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

  }

  @Test
  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();
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

    }
  }

  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();
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.updateRef()

    assertNull("has no " + Constants.HEAD, head);
  }

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