本文整理汇总了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);
}
示例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;
}
示例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();
}
示例4: getId
import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
@Override
protected Object getId(final RepositoryCommit resource) {
return resource.getSha();
}