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


Java RepositoryCommit.getSha方法代码示例

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


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

示例1: createIntent

import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
/**
 * Create intent for this activity
 *
 * @param repository
 * @param position
 * @param commits
 * @return intent
 */
public static Intent createIntent(final Repository repository,
        final int position, final Collection<RepositoryCommit> commits) {
    String[] ids = new String[commits.size()];
    int index = 0;
    for (RepositoryCommit commit : commits)
        ids[index++] = commit.getSha();
    return createIntent(repository, position, ids);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:17,代码来源:CommitViewActivity.java

示例2: transformToChangeset

import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
public static Changeset transformToChangeset(RepositoryCommit repositoryCommit, int repositoryId, String branch)
  {
      final List<ChangesetFileDetail> changesetFiles = transformToFileDetails(repositoryCommit.getFiles());

      String name = "";
      String authorEmail = null;

      Date date = Calendar.getInstance().getTime();

      if (repositoryCommit.getCommit() != null
              && repositoryCommit.getCommit().getAuthor() != null)
      {

          if (StringUtils.isNotBlank(repositoryCommit.getCommit().getAuthor().getName()))
          {
              name = repositoryCommit.getCommit().getAuthor().getName();
          }
          // TODO commit date is in getCommt().getCommitter().getDate(), should we use this instead
          // after git commit --ammend command, the dates were different
          date = repositoryCommit.getCommit().getAuthor().getDate();
          authorEmail = repositoryCommit.getCommit().getAuthor().getEmail();
      }

      // try to get login from Author, if there is no Author try from Commiter
      String login = getUserLogin(repositoryCommit.getAuthor());
      if (StringUtils.isBlank(login))
      {
          login = getUserLogin(repositoryCommit.getCommitter());
      }

      Changeset changeset = new Changeset(
              repositoryId,
              repositoryCommit.getSha(),
              name,
              login,
              date,
              "", // todo: raw-node. what is it in github?
              branch,
              repositoryCommit.getCommit().getMessage(),
              transformParents(repositoryCommit.getParents()),
              ImmutableList.<ChangesetFile>copyOf(changesetFiles),
              changesetFiles.size(),
              authorEmail
      );

return changeset;
  }
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:48,代码来源:GithubChangesetFactory.java

示例3: getSha

import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
private String getSha(final RepositoryCommit source)
{
    return source.getSha() != null ? source.getSha() : source.getCommit().getSha();
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:5,代码来源:GitHubPullRequestProcessor.java

示例4: getId

import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
@Override
protected Object getId(final RepositoryCommit resource) {
    return resource.getSha();
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:5,代码来源:CommitPager.java


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