]> source.dussan.org Git - gitblit.git/commitdiff
Fix bug in migrating to BranchTicketService 83/183/1
authorJames Moger <james.moger@gitblit.com>
Wed, 17 Sep 2014 20:05:42 +0000 (16:05 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 17 Sep 2014 20:05:42 +0000 (16:05 -0400)
src/main/java/com/gitblit/tickets/BranchTicketService.java

index 8c000550a00eb7edc8d71c5d34c70eb6fbabc28a..5a42c6a7de271bbac22abea0551f124c055b555b 100644 (file)
@@ -823,8 +823,12 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi
                List<DirCacheEntry> list = new ArrayList<DirCacheEntry>();
                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);