feat(repo): support cloning from a leaf group
Closes #7887 (closed).
glab repo clone --preserve-namespace --group org/platform/backend recreates all ancestor folders. Add --leaf-group so the local tree starts at backend/ while preserving subgroups. Projects shared from outside the selected group keep their full namespace. Resolve the canonical group path so numeric IDs work too. If two projects map to the same local path, the command reports both projects and the destination before starting any clone.
Validation: make gen-docs, go test -race -count=1 ./internal/commands/project/clone, and the build, Go lint, generated-file checks, and 278 affected tests from the pre-push hook passed. The tests cover a numeric group ID, a project directly under the leaf group, a nested subgroup, shared projects from a sibling and a separate top-level group, and a destination collision that leaves all clones unstarted.
AI assistance was used to develop this change.
/copy_metadata #7887 (closed)
Before and after
Both revisions cloned the same two local fixture repositories. The base command creates demo/platform/backend/. With --leaf-group, the MR revision creates backend/ and keeps tools/worker nested under it.
