loader: get_mgroup filter out non-directories
authorJean Privat <jean@pryen.org>
Mon, 24 Aug 2015 19:49:17 +0000 (15:49 -0400)
committerJean Privat <jean@pryen.org>
Wed, 26 Aug 2015 12:05:58 +0000 (08:05 -0400)
This was implicit because non-directories do not match the heuristics

Signed-off-by: Jean Privat <jean@pryen.org>

src/loader.nit

index 53b2234..2516f3a 100644 (file)
@@ -388,6 +388,13 @@ redef class ModelBuilder
                        return mgroups[rdp]
                end
 
+               # Filter out non-directories
+               var stat = dirpath.file_stat
+               if stat == null or not stat.is_dir then
+                       mgroups[rdp] = null
+                       return null
+               end
+
                # Hack, a group is determined by one of the following:
                # * the presence of a honomymous nit file
                # * the fact that the directory is named `src`