James Moger
2012-03-05 9357e929bdc1237577b6f6302861dce0e9d1e39c
Not all GitNotes were displayed on the commit page (issue-70)
2 files modified
18 ■■■■ changed files
docs/04_releases.mkd 1 ●●●● patch | view | raw | blame | history
src/com/gitblit/utils/JGitUtils.java 17 ●●●● patch | view | raw | blame | history
docs/04_releases.mkd
@@ -31,6 +31,7 @@
#### fixes 
- Uppercase repositories not selectable in edit palettes (issue 71)
- Not all git notes were properly displayed on the commit page (issue 70)
- Activity page now displays all local branches (issue 65)
- Fixed (harmless) nullpointer on pushing to an empty repository (issue 69)
- Fixed possible nullpointer from the servlet container on startup (issue 67)
src/com/gitblit/utils/JGitUtils.java
@@ -1453,10 +1453,23 @@
        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