summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-05 16:33:46 -0500
committerJames Moger <james.moger@gitblit.com>2012-03-05 16:33:46 -0500
commit9357e929bdc1237577b6f6302861dce0e9d1e39c (patch)
tree46f6d77f0556995629391197a27697239256db54 /src/com/gitblit/utils
parent6fa6abf07be67bba86e9781a4028c4b3863b50f7 (diff)
downloadgitblit-9357e929bdc1237577b6f6302861dce0e9d1e39c.tar.gz
gitblit-9357e929bdc1237577b6f6302861dce0e9d1e39c.zip
Not all GitNotes were displayed on the commit page (issue 70)
Diffstat (limited to 'src/com/gitblit/utils')
-rw-r--r--src/com/gitblit/utils/JGitUtils.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 5f193d02..c39ab715 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -1453,10 +1453,23 @@ public class JGitUtils {
List<RefModel> noteBranches = getNoteBranches(repository, true, -1);
for (RefModel notesRef : noteBranches) {
RevTree notesTree = JGitUtils.getCommit(repository, notesRef.getName()).getTree();
+ // 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, '/');
- String notePath = sb.toString();
- String text = getStringContent(repository, notesTree, notePath);
+ 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