当前位置: 首页>>代码示例>>Java>>正文


Java ReceiveCommand.getRefName方法代码示例

本文整理汇总了Java中org.eclipse.jgit.transport.ReceiveCommand.getRefName方法的典型用法代码示例。如果您正苦于以下问题:Java ReceiveCommand.getRefName方法的具体用法?Java ReceiveCommand.getRefName怎么用?Java ReceiveCommand.getRefName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.transport.ReceiveCommand的用法示例。


在下文中一共展示了ReceiveCommand.getRefName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDraftIds

import org.eclipse.jgit.transport.ReceiveCommand; //导入方法依赖的package包/类
private Table<Change.Id, Account.Id, ObjectId> getDraftIds() {
  Table<Change.Id, Account.Id, ObjectId> draftIds = HashBasedTable.create();
  if (allUsersRepo == null) {
    return draftIds;
  }
  for (ReceiveCommand cmd : allUsersRepo.getCommandsSnapshot()) {
    String r = cmd.getRefName();
    if (r.startsWith(REFS_DRAFT_COMMENTS)) {
      Change.Id changeId = Change.Id.fromRefPart(r.substring(REFS_DRAFT_COMMENTS.length()));
      Account.Id accountId = Account.Id.fromRefSuffix(r);
      checkDraftRef(accountId != null && changeId != null, r);
      draftIds.put(changeId, accountId, cmd.getNewId());
    }
  }
  return draftIds;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:17,代码来源:NoteDbUpdateManager.java

示例2: parseCreate

import org.eclipse.jgit.transport.ReceiveCommand; //导入方法依赖的package包/类
private void parseCreate(ReceiveCommand cmd)
    throws PermissionBackendException, NoSuchProjectException, IOException {
  RevObject obj;
  try {
    obj = rp.getRevWalk().parseAny(cmd.getNewId());
  } catch (IOException err) {
    logError(
        "Invalid object " + cmd.getNewId().name() + " for " + cmd.getRefName() + " creation",
        err);
    reject(cmd, "invalid object");
    return;
  }
  logDebug("Creating {}", cmd);

  if (isHead(cmd) && !isCommit(cmd)) {
    return;
  }

  Branch.NameKey branch = new Branch.NameKey(project.getName(), cmd.getRefName());
  try {
    // Must pass explicit user instead of injecting a provider into CreateRefControl, since
    // Provider<CurrentUser> within ReceiveCommits will always return anonymous.
    createRefControl.checkCreateRef(Providers.of(user), rp.getRepository(), branch, obj);
  } catch (AuthException denied) {
    reject(cmd, "prohibited by Gerrit: " + denied.getMessage());
    return;
  }

  if (!validRefOperation(cmd)) {
    // validRefOperation sets messages, so no need to provide more feedback.
    return;
  }

  validateNewCommits(new Branch.NameKey(project.getNameKey(), cmd.getRefName()), cmd);
  actualCommands.add(cmd);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:37,代码来源:ReceiveCommits.java

示例3: Command

import org.eclipse.jgit.transport.ReceiveCommand; //导入方法依赖的package包/类
private Command(ReceiveCommand receiveCommand) {
  this.refName = receiveCommand.getRefName();
  this.type = receiveCommand.getType();
}
 
开发者ID:kamegu,项目名称:git-webapp,代码行数:5,代码来源:GwReceiveHook.java


注:本文中的org.eclipse.jgit.transport.ReceiveCommand.getRefName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。