]> source.dussan.org Git - gitblit.git/commitdiff
Not all GitNotes were displayed on the commit page (issue 70)
authorJames Moger <james.moger@gitblit.com>
Mon, 5 Mar 2012 21:33:46 +0000 (16:33 -0500)
committerJames Moger <james.moger@gitblit.com>
Mon, 5 Mar 2012 21:33:46 +0000 (16:33 -0500)
docs/04_releases.mkd
src/com/gitblit/utils/JGitUtils.java

index fed78166a17929a09c38d116f33f99e583d72d5d..b2d0c7761cd9a8f4311ce9604d27600265c09972 100644 (file)
@@ -31,6 +31,7 @@ Push requests to these repositories will be rejected.
 #### fixes \r
 \r
 - Uppercase repositories not selectable in edit palettes (issue 71)\r
+- Not all git notes were properly displayed on the commit page (issue 70)\r
 - Activity page now displays all local branches (issue 65)\r
 - Fixed (harmless) nullpointer on pushing to an empty repository (issue 69)\r
 - Fixed possible nullpointer from the servlet container on startup (issue 67)\r
index 5f193d02426bbdd0375bb278ca0b703a708ac021..c39ab715da5f115369583996f91b33352322a7dc 100644 (file)
@@ -1453,10 +1453,23 @@ public class JGitUtils {
                List<RefModel> noteBranches = getNoteBranches(repository, true, -1);\r
                for (RefModel notesRef : noteBranches) {\r
                        RevTree notesTree = JGitUtils.getCommit(repository, notesRef.getName()).getTree();\r
+                       // flat notes list\r
+                       String notePath = commit.getName();\r
+                       String text = getStringContent(repository, notesTree, notePath);\r
+                       if (!StringUtils.isEmpty(text)) {\r
+                               List<RevCommit> history = getRevLog(repository, notesRef.getName(), notePath, 0, -1);\r
+                               RefModel noteRef = new RefModel(notesRef.displayName, null, history.get(history\r
+                                               .size() - 1));\r
+                               GitNote gitNote = new GitNote(noteRef, text);\r
+                               list.add(gitNote);\r
+                               continue;\r
+                       }\r
+                       \r
+                       // folder structure\r
                        StringBuilder sb = new StringBuilder(commit.getName());\r
                        sb.insert(2, '/');\r
-                       String notePath = sb.toString();\r
-                       String text = getStringContent(repository, notesTree, notePath);\r
+                       notePath = sb.toString();\r
+                       text = getStringContent(repository, notesTree, notePath);\r
                        if (!StringUtils.isEmpty(text)) {\r
                                List<RevCommit> history = getRevLog(repository, notesRef.getName(), notePath, 0, -1);\r
                                RefModel noteRef = new RefModel(notesRef.displayName, null, history.get(history\r