// flat notes list
String notePath = commit.getName();
String text = getStringContent(repository, notesTree, notePath);
if (!StringUtils.isEmpty(text)) {
List<RevCommit> history = getRevLog(repository, notesRef.getName(), notePath, 0, -1);
RefModel noteRef = new RefModel(notesRef.displayName, null, history.get(history
.size() - 1));
GitNote gitNote = new GitNote(noteRef, text);
list.add(gitNote);
continue;
}
// folder structure
StringBuilder sb = new StringBuilder(commit.getName());
sb.insert(2, '/');
notePath = sb.toString();
text = getStringContent(repository, notesTree, notePath);
if (!StringUtils.isEmpty(text)) {
List<RevCommit> history = getRevLog(repository, notesRef.getName(), notePath, 0, -1);
RefModel noteRef = new RefModel(notesRef.displayName, null, history.get(history
.size() - 1));
GitNote gitNote = new GitNote(noteRef, text);
list.add(gitNote);
}
}