]> source.dussan.org Git - jgit.git/commitdiff
eclipse-iplog: Require at least one project section 40/340/2
authorShawn O. Pearce <spearce@spearce.org>
Thu, 11 Mar 2010 19:58:09 +0000 (11:58 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 11 Mar 2010 23:15:03 +0000 (15:15 -0800)
We need at least one project definition to dump out a reasonably
sane IP log file in XML format.

Change-Id: I5cfcd70cd98e29159014cf3dbf0433dd9c49d49c
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java

index 040887ece4aafbeef7b76d941090214aee38fde4..417c5065504200360664051a96504e1f68069b27 100644 (file)
@@ -211,6 +211,12 @@ public class IpLogGenerator {
                                        + " is invalid", e);
                }
 
+               if (meta.getProjects().isEmpty()) {
+                       throw new ConfigInvalidException("Configuration file "
+                                       + log.getPathString() + " in commit " + commit.name()
+                                       + " has no projects declared.");
+               }
+
                for (Project p : meta.getProjects()) {
                        p.setVersion(version);
                        projects.put(p.getName(), p);