diff --git a/internal/mod/modload/testdata/tidy/preserve-custom.txtar b/internal/mod/modload/testdata/tidy/preserve-custom.txtar new file mode 100644 index 000000000..af6ba6a60 --- /dev/null +++ b/internal/mod/modload/testdata/tidy/preserve-custom.txtar @@ -0,0 +1,20 @@ +-- cue.mod/module.cue -- +module: "cue.example" +language: { + version: "v0.12.0" +} +custom: { + "example.com/mycoolmodule": { + test: "data" + } +} +-- want -- +module: "cue.example" +language: { + version: "v0.12.0" +} +custom: { + "example.com/mycoolmodule": { + test: "data" + } +} \ No newline at end of file diff --git a/internal/mod/modload/tidy.go b/internal/mod/modload/tidy.go index 755aaafe9..7913e1097 100644 --- a/internal/mod/modload/tidy.go +++ b/internal/mod/modload/tidy.go @@ -156,6 +156,7 @@ func modfileFromRequirements(old *modfile.File, rs *modrequirements.Requirements Language: old.Language, Deps: make(map[string]*modfile.Dep), Source: old.Source, + Custom: old.Custom, } defaults := rs.DefaultMajorVersions() for _, v := range rs.RootModules() {