本文整理汇总了Java中org.eclipse.jgit.revwalk.RevCommit.getFullMessage方法的典型用法代码示例。如果您正苦于以下问题:Java RevCommit.getFullMessage方法的具体用法?Java RevCommit.getFullMessage怎么用?Java RevCommit.getFullMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.revwalk.RevCommit
的用法示例。
在下文中一共展示了RevCommit.getFullMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GitTool
import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
public GitTool() {
File gitWorkDir = new File(".");
try {
Git git = Git.open(gitWorkDir);
Iterable<RevCommit> commits = git.log().all().call();
Repository repo = git.getRepository();
branch = repo.getBranch();
RevCommit latestCommit = commits.iterator().next();
name = latestCommit.getName();
message = latestCommit.getFullMessage();
} catch (Throwable e) {
name = "";
message = "";
branch = "";
}
}
示例2: getDetailMessage
import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
@Nullable
public static String getDetailMessage(RevCommit commit) {
int start = 0;
String fullMessage = commit.getFullMessage();
while (true) {
int index = fullMessage.indexOf('\n', start);
if (index == -1)
return null;
start = index+1;
int nextIndex = fullMessage.indexOf('\n', start);
if (nextIndex == -1)
return null;
start = nextIndex+1;
if (fullMessage.substring(index, nextIndex).trim().length() == 0) {
String detailMessage = fullMessage.substring(start).trim();
return detailMessage.length()!=0?detailMessage:null;
}
}
}
示例3: extractTestResultsExpectations
import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
private Collection<TestResult> extractTestResultsExpectations(RevCommit commit) {
final Set<TestResult> testResultExpectations = new HashSet<>();
final String fullMessage = commit.getFullMessage();
final Matcher matcher = TEST_RESULT_ENTRY_PATTERN.matcher(fullMessage);
while (matcher.find()) {
final String[] testResultParts = matcher.group().trim().split(" ");
testResultExpectations.add(TestResult.from(testResultParts));
}
return testResultExpectations;
}
示例4: getCommitMessage
import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
@Override
public String getCommitMessage( String commitId ) {
if ( commitId.equals( IVCS.WORKINGTREE ) ) {
try {
String merge_msg = git.getRepository().readMergeCommitMsg();
return merge_msg == null ? "" : merge_msg;
} catch ( Exception e ) {
return e.getMessage();
}
} else {
RevCommit commit = resolve( commitId );
return commit.getFullMessage();
}
}