Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.BatchRefUpdate.addCommand()


        newCommand(A, B, "refs/heads/master",
            ReceiveCommand.Type.UPDATE),
        newCommand(B, A, "refs/heads/masters",
            ReceiveCommand.Type.UPDATE_NONFASTFORWARD));
    BatchRefUpdate batchUpdate = refdir.newBatchUpdate();
    batchUpdate.addCommand(commands);
    batchUpdate.execute(new RevWalk(diskRepo), new StrictWorkMonitor());
    Map<String, Ref> refs = refdir.getRefs(RefDatabase.ALL);
    assertEquals(ReceiveCommand.Result.OK, commands.get(0).getResult());
    assertEquals(ReceiveCommand.Result.REJECTED_NONFASTFORWARD, commands
        .get(1).getResult());
View Full Code Here


            ReceiveCommand.Type.UPDATE),
        newCommand(B, A, "refs/heads/masters",
            ReceiveCommand.Type.UPDATE_NONFASTFORWARD));
    BatchRefUpdate batchUpdate = refdir.newBatchUpdate();
    batchUpdate.setAllowNonFastForwards(true);
    batchUpdate.addCommand(commands);
    batchUpdate.execute(new RevWalk(diskRepo), new StrictWorkMonitor());
    Map<String, Ref> refs = refdir.getRefs(RefDatabase.ALL);
    assertEquals(ReceiveCommand.Result.OK, commands.get(0).getResult());
    assertEquals(ReceiveCommand.Result.OK, commands.get(1).getResult());
    assertEquals("[HEAD, refs/heads/master, refs/heads/masters]", refs
View Full Code Here

    List<ReceiveCommand> commands = Arrays.asList(
        newCommand(B, A, "refs/heads/master",
            ReceiveCommand.Type.UPDATE_NONFASTFORWARD));
    BatchRefUpdate batchUpdate = refdir.newBatchUpdate();
    batchUpdate.setAllowNonFastForwards(true);
    batchUpdate.addCommand(commands);
    batchUpdate.execute(new RevWalk(diskRepo) {
      @Override
      public boolean isMergedInto(RevCommit base, RevCommit tip) {
        throw new AssertionError("isMergedInto() should not be called");
      }
View Full Code Here

        newCommand(null, A, "refs/heads/master/x",
            ReceiveCommand.Type.CREATE),
        newCommand(null, A, "refs/heads", ReceiveCommand.Type.CREATE));
    BatchRefUpdate batchUpdate = refdir.newBatchUpdate();
    batchUpdate.setAllowNonFastForwards(true);
    batchUpdate.addCommand(commands);
    batchUpdate
        .execute(new RevWalk(diskRepo), NullProgressMonitor.INSTANCE);
    Map<String, Ref> refs = refdir.getRefs(RefDatabase.ALL);
    assertEquals(ReceiveCommand.Result.OK, commands.get(0).getResult());
    assertEquals(ReceiveCommand.Result.LOCK_FAILURE, commands.get(1)
View Full Code Here

            ReceiveCommand.Type.CREATE),
        newCommand(B, null, "refs/heads/masters",
            ReceiveCommand.Type.DELETE));
    BatchRefUpdate batchUpdate = refdir.newBatchUpdate();
    batchUpdate.setAllowNonFastForwards(true);
    batchUpdate.addCommand(commands);
    batchUpdate.execute(new RevWalk(diskRepo), new StrictWorkMonitor());
    Map<String, Ref> refs = refdir.getRefs(RefDatabase.ALL);
    assertEquals(ReceiveCommand.Result.OK, commands.get(0).getResult());
    assertEquals(ReceiveCommand.Result.OK, commands.get(1).getResult());
    assertEquals(ReceiveCommand.Result.OK, commands.get(2).getResult());
View Full Code Here

    BatchRefUpdate batch = db.getRefDatabase().newBatchUpdate();
    batch.setAllowNonFastForwards(isAllowNonFastForwards());
    batch.setRefLogIdent(getRefLogIdent());
    batch.setRefLogMessage("push", true); //$NON-NLS-1$
    batch.addCommand(toApply);
    try {
      batch.execute(walk, updating);
    } catch (IOException err) {
      for (ReceiveCommand cmd : toApply) {
        if (cmd.getResult() == Result.NOT_ATTEMPTED)
View Full Code Here

    BatchRefUpdate batch = db.getRefDatabase().newBatchUpdate();
    batch.setAllowNonFastForwards(isAllowNonFastForwards());
    batch.setRefLogIdent(getRefLogIdent());
    batch.setRefLogMessage("push", true);
    batch.addCommand(toApply);
    try {
      batch.execute(walk, updating);
    } catch (IOException err) {
      for (ReceiveCommand cmd : toApply) {
        if (cmd.getResult() == Result.NOT_ATTEMPTED)
View Full Code Here

      }
      if (transport.isRemoveDeletedRefs())
        deleteStaleTrackingRefs(result, batch);
      for (TrackingRefUpdate u : localUpdates) {
        result.add(u);
        batch.addCommand(u.asReceiveCommand());
      }
      for (ReceiveCommand cmd : batch.getCommands()) {
        cmd.updateType(walk);
        if (cmd.getType() == UPDATE_NONFASTFORWARD
            && cmd instanceof TrackingRefUpdate.Command
View Full Code Here

      }
      if (transport.isRemoveDeletedRefs())
        deleteStaleTrackingRefs(result, batch);
      for (TrackingRefUpdate u : localUpdates) {
        result.add(u);
        batch.addCommand(u.asReceiveCommand());
      }
      for (ReceiveCommand cmd : batch.getCommands()) {
        cmd.updateType(walk);
        if (cmd.getType() == UPDATE_NONFASTFORWARD
            && cmd instanceof TrackingRefUpdate.Command
View Full Code Here

    BatchRefUpdate batch = db.getRefDatabase().newBatchUpdate();
    batch.setAllowNonFastForwards(isAllowNonFastForwards());
    batch.setRefLogIdent(getRefLogIdent());
    batch.setRefLogMessage("push", true); //$NON-NLS-1$
    batch.addCommand(toApply);
    try {
      batch.execute(walk, updating);
    } catch (IOException err) {
      for (ReceiveCommand cmd : toApply) {
        if (cmd.getResult() == Result.NOT_ATTEMPTED)
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.