Package org.eclipse.jgit.lib

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


    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 (cmd.getNewId().equals(ObjectId.zeroId())) {
          // ref deletion request
          if (cmd.getRefName().startsWith(Constants.R_TICKET)) {
            if (user.canDeleteRef(repository)) {
              batch.addCommand(cmd);
            } else {
              sendRejection(cmd, "Sorry, you do not have permission to delete {}", cmd.getRefName());
            }
          } else {
            sendRejection(cmd, "Sorry, you can not delete {}", cmd.getRefName());
View Full Code Here

        }

        patchsetRefCmd = cmd;
        patchsetCmd = preparePatchset(cmd);
        if (patchsetCmd != null) {
          batch.addCommand(patchsetCmd);
        }
        continue;
      }

      batch.addCommand(cmd);
View Full Code Here

          batch.addCommand(patchsetCmd);
        }
        continue;
      }

      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
View Full Code Here

    for (ReceiveCommand cmd : toApply) {
      if (Result.NOT_ATTEMPTED != cmd.getResult()) {
        // Already rejected by the core receive process.
        continue;
      }
      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
View Full Code Here

        if (cmd.getNewId().equals(ObjectId.zeroId())) {
          // ref deletion request
          if (cmd.getRefName().startsWith(Constants.R_TICKET)) {
            if (user.canDeleteRef(repository)) {
              batch.addCommand(cmd);
            } else {
              sendRejection(cmd, "Sorry, you do not have permission to delete {}", cmd.getRefName());
            }
          } else {
            sendRejection(cmd, "Sorry, you can not delete {}", cmd.getRefName());
View Full Code Here

        }

        patchsetRefCmd = cmd;
        patchsetCmd = preparePatchset(cmd);
        if (patchsetCmd != null) {
          batch.addCommand(patchsetCmd);
        }
        continue;
      }

      batch.addCommand(cmd);
View Full Code Here

          batch.addCommand(patchsetCmd);
        }
        continue;
      }

      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
View Full Code Here

    for (ReceiveCommand cmd : toApply) {
      if (Result.NOT_ATTEMPTED != cmd.getResult()) {
        // Already rejected by the core receive process.
        continue;
      }
      batch.addCommand(cmd);
    }

    if (!batch.getCommands().isEmpty()) {
      try {
        batch.execute(getRevWalk(), updating);
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

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.