summaryrefslogtreecommitdiffstats
path: root/tests/test_command.py
Commit message (Collapse)AuthorAgeFilesLines
* command: preserve project filters in regex selectionVictor Pushkarev2026-09-161-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | `FindProjects` gets its candidate projects from `GetProjects` and then applies regex matching. However, it only forwards `all_manifests`, so other project filters are lost on regex paths. As a result, `repo forall -r/-i --groups` falls back to the configured group selection instead of using the requested groups. Similarly, `repo list -r --groups` ignores the requested groups, and `repo list -r --all` still excludes projects without a checkout. Pass `groups` and `missing_ok` through `FindProjects`, and forward the existing options from `forall` and `list`. When no group override is given, keep using each manifest's effective groups. Add regression tests for `FindProjects` and both command paths. Change-Id: I5dfc22172fdd81de5312a84433867300a1342aec Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/631281 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Victor Pushkarev <corvinus.v@gmail.com> Tested-by: Victor Pushkarev <corvinus.v@gmail.com>
* command: fix group selection across submanifestsVictor Pushkarev2026-09-111-3/+144
| | | | | | | | | | | | | | | | | | | | | | | When GetProjects walks all manifests without explicit groups, it resolves the effective groups once from the selected manifest and reuses them for projects from child manifests. This can ignore a child manifest's own group selection and include projects that should be excluded. When no groups are specified, resolve them from each project's owning manifest. Explicit groups still apply to all projects in the call, and single-manifest behavior remains unchanged. Add regression tests for per-manifest group selection, explicit overrides, and name lookup across manifests. Bug: 382086294 Change-Id: Id5c7e52410431b86b395f489cfd494ca05620975 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/624821 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Victor Pushkarev <corvinus.v@gmail.com> Tested-by: Victor Pushkarev <corvinus.v@gmail.com>
* sync: Add CLI flag for globally disabling submodule fetchJosef Malmström2026-07-161-0/+31
| | | | | | | | | | | | | | | | A global setting for disabling fetching of submodules is useful since this can currently otherwise only be done by modifying the manifest, or by explicitly providing projects on command line. Add this setting as --no-fetch-submodules to mirror the existing --fetch-submodules. Change-Id: Ic727c54f11a594aa52315751284b87138cf246bb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/607641 Commit-Queue: Josef Malmstrom <Josef.Malmstrom@arm.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Josef Malmstrom <Josef.Malmstrom@arm.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Fix submodules not synced for repeated repoJosef Malmström2026-05-201-0/+88
If I check out e.g. multiple branches of the same repo in one manifest, only the submodules of one checkout are synced. Fix this by adding the relative path of the checkout as a key to the mapping of derived projects, preventing overwrite. The fix was originally proposed here: https://issues.gerritcodereview.com/issues/40013218 Bug: 40013218 Change-Id: Ia86518ccf2c0af7bd7e4daf8d703a55b7e10ba52 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/581062 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Josef Malmstrom <Josef.Malmstrom@arm.com> Tested-by: Josef Malmstrom <Josef.Malmstrom@arm.com>