本文整理汇总了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;
}
示例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);
}
示例3: Command
import org.eclipse.jgit.transport.ReceiveCommand; //导入方法依赖的package包/类
private Command(ReceiveCommand receiveCommand) {
this.refName = receiveCommand.getRefName();
this.type = receiveCommand.getType();
}