sync: don't let --nmu affect smart sync

--no-manifest-update has always meant "use the existing manifest
checkout as-is": it skips updating .repo/manifests and nothing else.
Smart sync pins do not come from that checkout but from the manifest
server, and an explicit `-s --nmu` already works that way.

The manifest-driven default smart sync (sync-smartsync="true") instead
treated --nmu like -l: it disabled the implicit smart sync and kept an
existing smart_sync_override.xml. So on such manifests `repo sync --nmu`
fetched and checked out the previous pins (or ToT if there were none)
instead of doing what `repo sync` does minus the manifest checkout
update.

Make --nmu orthogonal to smart sync again: it no longer disables the
default smart sync, and it no longer keeps the override. Both have to
change together; otherwise a failed implicit smart sync under --nmu
would fall back to ToT while leaving the override on disk. Only -l,
which skips fetching, keeps the override.

Bug: 569927750
Change-Id: I33730363df485d72cd86ae99bf5eb8399b58e81a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/641264
Reviewed-by: Brian Gan <brgan@google.com>
Commit-Queue: Rahul Yadav <yadavrah@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Rahul Yadav <yadavrah@google.com>
This commit is contained in:
Rahul Yadav authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-10-09 07:00:22 -07:00
1 parent 7bba4ee47e
commit 0a4e68f9d2
3 files changed
+55 -20

No files matched your search

+9 -5
View File
@@ -158,11 +158,15 @@ sync, as before. Options that specify an explicit target or manifest source
(such as `-t`/`--smart-tag`, `-m`/`--manifest-name` or
`--superproject-revision`) will also disable the default Smart Sync behavior.
With `-l`/`--local-only` or `--no-manifest-update`, the default Smart Sync does
not contact the manifest server. Instead, repo keeps using the
`smart_sync_override.xml` from the last Smart Sync, if there is one. Pass
`--no-smart-sync` to discard it and use the default manifest instead. These
options do not change the behavior of an explicit `-s`/`--smart-sync`.
With `-l`/`--local-only`, the default Smart Sync does not contact the manifest
server. Instead, repo keeps using the `smart_sync_override.xml` from the last
Smart Sync, if there is one. Pass `--no-smart-sync` to discard it and use the
default manifest instead. These options do not change the behavior of an
explicit `-s`/`--smart-sync`.
`--no-manifest-update` only skips updating the manifest checkout. It does not
affect Smart Sync: the default Smart Sync still runs, and an existing
`smart_sync_override.xml` is replaced or removed as in a regular sync.
### --smart-sync / -s