From ab9c0ce1bbd67dbb1236312123a3e24a74e097c6 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 17 Sep 2014 16:05:42 -0400 Subject: [PATCH] Fix bug in migrating to BranchTicketService --- src/main/java/com/gitblit/tickets/BranchTicketService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/tickets/BranchTicketService.java b/src/main/java/com/gitblit/tickets/BranchTicketService.java index 8c000550..5a42c6a7 100644 --- a/src/main/java/com/gitblit/tickets/BranchTicketService.java +++ b/src/main/java/com/gitblit/tickets/BranchTicketService.java @@ -823,8 +823,12 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi List list = new ArrayList(); TreeWalk tw = null; try { - tw = new TreeWalk(db); ObjectId treeId = db.resolve(BRANCH + "^{tree}"); + if (treeId == null) { + // branch does not exist yet, could be migrating tickets + return list; + } + tw = new TreeWalk(db); int hIdx = tw.addTree(treeId); tw.setRecursive(true); -- 2.39.5