本文整理汇总了Java中org.eclipse.jgit.revwalk.RevTag.getTaggerIdent方法的典型用法代码示例。如果您正苦于以下问题:Java RevTag.getTaggerIdent方法的具体用法?Java RevTag.getTaggerIdent怎么用?Java RevTag.getTaggerIdent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.revwalk.RevTag
的用法示例。
在下文中一共展示了RevTag.getTaggerIdent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalGetDate
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
private Date internalGetDate(RevObject referencedObject) {
Date date = new Date(0);
if (referencedObject != null) {
if (referencedObject instanceof RevTag) {
RevTag tag = (RevTag) referencedObject;
PersonIdent tagger = tag.getTaggerIdent();
if (tagger != null) {
date = tagger.getWhen();
}
} else if (referencedObject instanceof RevCommit) {
RevCommit commit = (RevCommit) referencedObject;
date = JGitUtils.getAuthorDate(commit);
}
}
return date;
}
示例2: createTagInfo
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
public static TagInfo createTagInfo(
PermissionBackend.ForRef perm,
Ref ref,
RevWalk rw,
Project.NameKey projectName,
WebLinks links)
throws MissingObjectException, IOException {
RevObject object = rw.parseAny(ref.getObjectId());
Boolean canDelete = perm.testOrFalse(RefPermission.DELETE) ? true : null;
List<WebLinkInfo> webLinks = links.getTagLinks(projectName.get(), ref.getName());
if (object instanceof RevTag) {
// Annotated or signed tag
RevTag tag = (RevTag) object;
PersonIdent tagger = tag.getTaggerIdent();
return new TagInfo(
ref.getName(),
tag.getName(),
tag.getObject().getName(),
tag.getFullMessage().trim(),
tagger != null ? CommonConverters.toGitPerson(tag.getTaggerIdent()) : null,
canDelete,
webLinks.isEmpty() ? null : webLinks);
}
// Lightweight tag
return new TagInfo(
ref.getName(),
ref.getObjectId().getName(),
canDelete,
webLinks.isEmpty() ? null : webLinks);
}
示例3: TagHelper
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
TagHelper(RevTag t, CommitHelper c) {
this.tag = t;
this.author = t.getTaggerIdent();
this.refName = t.getTagName();
this.shortMessage = t.getShortMessage();
this.fullMessage = t.getFullMessage();
this.isAnnotated = true;
this.commit = c;
}
示例4: apply
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
public Long apply(RevTag tag) {
PersonIdent taggerIdent = tag.getTaggerIdent();
if (taggerIdent != null) {
return taggerIdent.getWhen().getTime();
}
try {
return evaluate(revWalk.parseAny(tag.getObject()), this);
} catch (IOException e) {
throw new RuntimeException();
}
}
示例5: toSoyData
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
public Map<String, Object> toSoyData(RevTag tag) {
Map<String, Object> data = Maps.newHashMapWithExpectedSize(4);
data.put("sha", ObjectId.toString(tag));
if (tag.getTaggerIdent() != null) {
data.put("tagger", CommitSoyData.toSoyData(tag.getTaggerIdent(), dateFormatter));
}
data.put("object", ObjectId.toString(tag.getObject()));
data.put("message", linkifier.linkify(req, tag.getFullMessage()));
return data;
}
示例6: getDate
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
public Date getDate() {
Date date = new Date(0);
if (referencedObject != null) {
if (referencedObject instanceof RevTag) {
RevTag tag = (RevTag) referencedObject;
if (tag.getTaggerIdent() != null) {
date = tag.getTaggerIdent().getWhen();
}
} else if (referencedObject instanceof RevCommit) {
date = ((RevCommit) referencedObject).getCommitterIdent().getWhen();
}
}
return date;
}
示例7: checkCreateRef
import org.eclipse.jgit.revwalk.RevTag; //导入方法依赖的package包/类
/**
* Checks whether the {@link CurrentUser} can create a new Git ref.
*
* @param user the user performing the operation
* @param repo repository on which user want to create
* @param branch the branch the new {@link RevObject} should be created on
* @param object the object the user will start the reference with
* @throws AuthException if creation is denied; the message explains the denial.
* @throws PermissionBackendException on failure of permission checks.
*/
public void checkCreateRef(
Provider<? extends CurrentUser> user,
Repository repo,
Branch.NameKey branch,
RevObject object)
throws AuthException, PermissionBackendException, NoSuchProjectException, IOException {
ProjectState ps = projectCache.checkedGet(branch.getParentKey());
if (ps == null) {
throw new NoSuchProjectException(branch.getParentKey());
}
if (!ps.getProject().getState().permitsWrite()) {
throw new AuthException("project state does not permit write");
}
PermissionBackend.ForRef perm = permissionBackend.user(user).ref(branch);
if (object instanceof RevCommit) {
perm.check(RefPermission.CREATE);
checkCreateCommit(user, repo, (RevCommit) object, ps, perm);
} else if (object instanceof RevTag) {
RevTag tag = (RevTag) object;
try (RevWalk rw = new RevWalk(repo)) {
rw.parseBody(tag);
} catch (IOException e) {
log.error(String.format("RevWalk(%s) parsing %s:", branch.getParentKey(), tag.name()), e);
throw e;
}
// If tagger is present, require it matches the user's email.
PersonIdent tagger = tag.getTaggerIdent();
if (tagger != null
&& (!user.get().isIdentifiedUser()
|| !user.get().asIdentifiedUser().hasEmailAddress(tagger.getEmailAddress()))) {
perm.check(RefPermission.FORGE_COMMITTER);
}
RevObject target = tag.getObject();
if (target instanceof RevCommit) {
checkCreateCommit(user, repo, (RevCommit) target, ps, perm);
} else {
checkCreateRef(user, repo, branch, target);
}
// If the tag has a PGP signature, allow a lower level of permission
// than if it doesn't have a PGP signature.
RefControl refControl = ps.controlFor(user.get()).controlForRef(branch);
if (tag.getFullMessage().contains("-----BEGIN PGP SIGNATURE-----\n")) {
if (!refControl.canPerform(Permission.CREATE_SIGNED_TAG)) {
throw new AuthException(Permission.CREATE_SIGNED_TAG + " not permitted");
}
} else if (!refControl.canPerform(Permission.CREATE_TAG)) {
throw new AuthException(Permission.CREATE_TAG + " not permitted");
}
}
}