Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: cipd/client/cmd/cipd/main.go

Issue 2663483002: [cipd] Add AssertOnlyDefaultSubdir. (Closed)
Patch Set: Common error Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cipd/client/cipd/common/common.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cmd/cipd/main.go
diff --git a/cipd/client/cmd/cipd/main.go b/cipd/client/cmd/cipd/main.go
index 54b973d0b5670747ecb385fbfd805feaacc202f0..61e1d674a0c9cb168d1da73e32b4248f75e16ee0 100644
--- a/cipd/client/cmd/cipd/main.go
+++ b/cipd/client/cmd/cipd/main.go
@@ -767,11 +767,10 @@ func ensurePackages(ctx context.Context, root string, desiredStateFile string, d
return nil, cipd.Actions{}, err
}
- baseSubdir := resolved.PackagesBySubdir[""]
- delete(resolved.PackagesBySubdir, "")
- if len(resolved.PackagesBySubdir) > 0 {
- return nil, cipd.Actions{}, errors.New("@Subdir not yet supported")
+ if err := resolved.PackagesBySubdir.AssertOnlyDefaultSubdir(); err != nil {
+ return nil, cipd.Actions{}, err
}
+ baseSubdir := resolved.PackagesBySubdir[""]
actions, err := client.EnsurePackages(ctx, baseSubdir, dryRun)
if err != nil {
« no previous file with comments | « cipd/client/cipd/common/common.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698