本文整理匯總了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();
}
}