本文整理汇总了Java中org.kohsuke.github.GitUser类的典型用法代码示例。如果您正苦于以下问题:Java GitUser类的具体用法?Java GitUser怎么用?Java GitUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GitUser类属于org.kohsuke.github包,在下文中一共展示了GitUser类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GhprcCause
import org.kohsuke.github.GitUser; //导入依赖的package包/类
public GhprcCause(String commit,
int pullID,
boolean merged,
String targetBranch,
String sourceBranch,
String authorEmail,
String title,
URL url,
GitUser commitAuthor) {
this.commit = commit;
this.pullID = pullID;
this.merged = merged;
this.targetBranch = targetBranch;
this.sourceBranch = sourceBranch;
this.authorEmail = authorEmail;
this.title = title;
this.url = url;
this.commitAuthor = commitAuthor;
}
示例2: addPullRequestToChange
import org.kohsuke.github.GitUser; //导入依赖的package包/类
private List<Id> addPullRequestToChange(ReviewDb db, GHPullRequest pr, Repository gitRepo)
throws Exception {
String destinationBranch = REFS_HEADS + pr.getBase().getRef();
List<Id> prChanges = Lists.newArrayList();
ObjectId baseObjectId = ObjectId.fromString(pr.getBase().getSha());
ObjectId prHeadObjectId = ObjectId.fromString(pr.getHead().getSha());
try (RevWalk walk = new RevWalk(gitRepo)) {
walk.markUninteresting(walk.lookupCommit(baseObjectId));
walk.markStart(walk.lookupCommit(prHeadObjectId));
walk.sort(RevSort.REVERSE);
int patchNr = 1;
for (GHPullRequestCommitDetail ghCommitDetail : pr.listCommits()) {
status.update(
Code.SYNC,
"Patch #" + patchNr,
"Patch#" + patchNr + ": Inserting PullRequest into Gerrit");
RevCommit revCommit = walk.parseCommit(ObjectId.fromString(ghCommitDetail.getSha()));
GHUser prUser = pr.getUser();
GitUser commitAuthor = ghCommitDetail.getCommit().getAuthor();
GitHubUser gitHubUser = GitHubUser.from(prUser, commitAuthor);
Account.Id pullRequestOwner = getOrRegisterAccount(db, gitHubUser);
Id changeId =
createChange.addCommitToChange(
db,
project,
gitRepo,
destinationBranch,
pullRequestOwner,
revCommit,
getChangeMessage(pr),
String.format(TOPIC_FORMAT, new Integer(pr.getNumber())));
if (changeId != null) {
prChanges.add(changeId);
}
}
return prChanges;
}
}
示例3: GitHubUser
import org.kohsuke.github.GitUser; //导入依赖的package包/类
private GitHubUser(GHUser gitHubUser, GitUser author) throws IOException {
this.login = initLogin(gitHubUser).or(generateLogin(author.getName()));
this.name = initFullName(gitHubUser).or(author.getName());
this.email = initEmail(gitHubUser).or(author.getEmail());
}
示例4: from
import org.kohsuke.github.GitUser; //导入依赖的package包/类
public static GitHubUser from(GHUser gitHubUser, GitUser author) throws IOException {
return new GitHubUser(gitHubUser, author);
}
示例5: getCommitAuthor
import org.kohsuke.github.GitUser; //导入依赖的package包/类
public GitUser getCommitAuthor() {
return commitAuthor;
}