gitlabhq/gitlabhq — pull request #4072 by jflemer-ndp (2013-05-25 17:51:54+00:00)
Title: Include groups in import with import repos rake task

The current behavior for the import repos task is to only find top-level repos, e.g. `{repo_dir}/*.git`. Projects already in groups (sub-directories), are not imported. This patch extends the existing import to create groups (as needed), and import projects into groups. Top-level projects are still imported with the same behavior as previously implemented.

Expand the import glob to include `**/*.git` to find projects in groups as well as top level projects. Check for existing group, and create group if needed. Set namespace_id for imported projects.

This has been tested (on v5.2) with a set of projects including top-level and grouped projects (one level deep only).