本文整理汇总了Java中org.eclipse.egit.github.core.RepositoryCommit.setAuthor方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryCommit.setAuthor方法的具体用法?Java RepositoryCommit.setAuthor怎么用?Java RepositoryCommit.setAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.egit.github.core.RepositoryCommit
的用法示例。
在下文中一共展示了RepositoryCommit.setAuthor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCommit
import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
/**
* Add commit to store
*
* @param repo
* @param commit
* @return commit
*/
public RepositoryCommit addCommit(IRepositoryIdProvider repo,
RepositoryCommit commit) {
RepositoryCommit current = getCommit(repo, commit.getSha());
if (current != null) {
current.setAuthor(commit.getAuthor());
current.setCommit(commit.getCommit());
current.setCommitter(commit.getCommitter());
current.setFiles(commit.getFiles());
current.setParents(commit.getParents());
current.setSha(commit.getSha());
current.setStats(commit.getStats());
current.setUrl(commit.getUrl());
return current;
} else {
String repoId = repo.generateId();
ItemReferences<RepositoryCommit> repoCommits = commits.get(repoId);
if (repoCommits == null) {
repoCommits = new ItemReferences<RepositoryCommit>();
commits.put(repoId, repoCommits);
}
repoCommits.put(commit.getSha(), commit);
return commit;
}
}
示例2: addRepositoryCommit
import org.eclipse.egit.github.core.RepositoryCommit; //导入方法依赖的package包/类
public synchronized RepositoryCommit addRepositoryCommit() {
User author = new User();
author.setEmail("[email protected]"); // TODO change
author.setHtmlUrl("http://github/someguy");
author.setLogin("someguy");
RepositoryCommit rc = new RepositoryCommit();
rc.setAuthor(author);
rc.setSha(fakeSha.incrementAndGet() + "");
LOG.debug("In MockCommitService added commit with sha " + rc.getSha());
commitsList.add(rc);
return rc;
}