Package org.eclipse.jgit.lib

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


    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)
          cmd.reject(err);
      }
View Full Code Here


      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
      } catch (IOException err) {
        for (ReceiveCommand cmd : toApply) {
          if (cmd.getResult() == Result.NOT_ATTEMPTED) {
            sendRejection(cmd, "lock error: {0}", err.getMessage());
            LOGGER.error(MessageFormat.format("failed to lock {0}:{1}",
View Full Code Here

      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
      } catch (IOException err) {
        for (ReceiveCommand cmd : toApply) {
          if (cmd.getResult() == Result.NOT_ATTEMPTED) {
            sendRejection(cmd, "lock error: {0}", err.getMessage());
          }
View Full Code Here

      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
      } catch (IOException err) {
        for (ReceiveCommand cmd : toApply) {
          if (cmd.getResult() == Result.NOT_ATTEMPTED) {
            sendRejection(cmd, "lock error: {0}", err.getMessage());
            LOGGER.error(MessageFormat.format("failed to lock {0}:{1}",
View Full Code Here

      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
      } catch (IOException err) {
        for (ReceiveCommand cmd : toApply) {
          if (cmd.getResult() == Result.NOT_ATTEMPTED) {
            sendRejection(cmd, "lock error: {0}", err.getMessage());
          }
View Full Code Here

        for (ReceiveCommand cmd : batch.getCommands()) {
          if (cmd.getResult() == NOT_ATTEMPTED)
            cmd.setResult(OK);
        }
      } else
        batch.execute(walk, monitor);
    } catch (IOException err) {
      throw new TransportException(MessageFormat.format(
          JGitText.get().failureUpdatingTrackingRef,
          getFirstFailedRefName(batch), err.getMessage()), err);
    } finally {
View Full Code Here

            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());
    assertEquals("[HEAD, refs/heads/master, refs/heads/masters]", refs
View Full Code Here

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

        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");
      }
    }, new StrictWorkMonitor());
View Full Code Here

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