diff options
author | James Moger <james.moger@gitblit.com> | 2011-06-02 22:40:23 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-06-02 22:40:23 -0400 |
commit | a125cf6876e0edc5a2498df57a9df06d60b1f572 (patch) | |
tree | 7e0757213e7b69c7e97c0fe7ac4b7e2edfc41b81 /src/com/gitblit/utils/TicgitUtils.java | |
parent | 793f76563d4bb3f58fa62ff53985e20561c6e330 (diff) | |
download | gitblit-a125cf6876e0edc5a2498df57a9df06d60b1f572.tar.gz gitblit-a125cf6876e0edc5a2498df57a9df06d60b1f572.zip |
Unit testing. Start of git-notes display feature.
Diffstat (limited to 'src/com/gitblit/utils/TicgitUtils.java')
-rw-r--r-- | src/com/gitblit/utils/TicgitUtils.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/com/gitblit/utils/TicgitUtils.java b/src/com/gitblit/utils/TicgitUtils.java index 914b8139..576de349 100644 --- a/src/com/gitblit/utils/TicgitUtils.java +++ b/src/com/gitblit/utils/TicgitUtils.java @@ -61,6 +61,9 @@ public class TicgitUtils { public static List<TicketModel> getTickets(Repository r) {
RefModel ticgitBranch = getTicketsBranch(r);
+ if (ticgitBranch == null) {
+ return null;
+ }
List<PathModel> paths = JGitUtils.getFilesInPath(r, null, ticgitBranch.commit);
List<TicketModel> tickets = new ArrayList<TicketModel>();
for (PathModel ticketFolder : paths) {
@@ -112,7 +115,7 @@ public class TicgitUtils { Comment c = new Comment(file.name, content);
ticket.comments.add(c);
} catch (ParseException e) {
- e.printStackTrace();
+ LOGGER.error("Failed to parse ticket comment", e);
}
} else if (chunks[0].equals("TAG")) {
if (content.startsWith("TAG_")) {
@@ -127,12 +130,4 @@ public class TicgitUtils { }
Collections.sort(ticket.comments);
}
-
- public static String getTicketContent(Repository r, String filePath) {
- RefModel ticketsBranch = getTicketsBranch(r);
- if (ticketsBranch != null) {
- return JGitUtils.getRawContentAsString(r, ticketsBranch.commit, filePath);
- }
- return "";
- }
}
|