fix: address verified review findings (repo-mutations-sync-1)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:38:53 +02:00
1 parent 0d47b3f149
commit 6e523d969d
11 files changed
+283 -30

No files matched your search

+7
View File
@@ -55,6 +55,13 @@ $ tea repo sync bob/project`,
remote, err := "", errNoMatchingRemote
if inside == "true" {
remote, err = a.checkoutRemote(cmd.Context(), target, snapshot)
// A remote preference only picks among the remotes of this repository: a repository
// argument that no remote here names is synced on the server, as without one.
if err != nil && len(args) > 0 && a.options.remote == "" {
if matches, matchErr := a.remotesForRepositoryURLs(cmd.Context(), target.hosts(), "", "", target.Repo); matchErr == nil && len(matches) == 0 {
err = errNoMatchingRemote
}
}
}
switch {
case errors.Is(err, errNoMatchingRemote) && len(args) > 0: