diff options
author | James Moger <james.moger@gitblit.com> | 2012-03-05 16:33:46 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-03-05 16:33:46 -0500 |
commit | 9357e929bdc1237577b6f6302861dce0e9d1e39c (patch) | |
tree | 46f6d77f0556995629391197a27697239256db54 | |
parent | 6fa6abf07be67bba86e9781a4028c4b3863b50f7 (diff) | |
download | gitblit-9357e929bdc1237577b6f6302861dce0e9d1e39c.tar.gz gitblit-9357e929bdc1237577b6f6302861dce0e9d1e39c.zip |
Not all GitNotes were displayed on the commit page (issue 70)
-rw-r--r-- | docs/04_releases.mkd | 1 | ||||
-rw-r--r-- | src/com/gitblit/utils/JGitUtils.java | 17 |
2 files changed, 16 insertions, 2 deletions
diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index fed78166..b2d0c776 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -31,6 +31,7 @@ Push requests to these repositories will be rejected. #### 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)
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
|