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


Java GitUser类代码示例

本文整理汇总了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;
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:21,代码来源:GhprcCause.java

示例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;
  }
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:44,代码来源:PullRequestImportJob.java

示例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());
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:6,代码来源:GitHubUser.java

示例4: from

import org.kohsuke.github.GitUser; //导入依赖的package包/类
public static GitHubUser from(GHUser gitHubUser, GitUser author) throws IOException {
  return new GitHubUser(gitHubUser, author);
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:4,代码来源:GitHubUser.java

示例5: getCommitAuthor

import org.kohsuke.github.GitUser; //导入依赖的package包/类
public GitUser getCommitAuthor() {
    return commitAuthor;
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:4,代码来源:GhprcPullRequest.java


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