Repository navigation
Commit 04a1a9d
committed
Keep go.mod as host for an unreadable in-memory root module
In memory, GoWorkspace::files counts a root go.mod that exists but
has no text the rewriter holds (a link, an unreadable file), and
conflict() reports such a root as "not a member" when go.work does not
use it. The rewriter passes has_go_mod from its candidate texts, so
replace_host saw no root module, chose go.work, and ran work_conflict:
the replace went into go.work, where it patches the members but never
the project. When the root is not a member, treat a root go.mod that
the in-memory workspace lists as the root's module, as on disk, so
go.mod hosts the replace and conflict() refuses it.
Found by Bugbot on df219a6.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent df219a6 commit 04a1a9d
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
802 | 808 | | |
803 | 809 | | |
804 | 810 | | |
| |||
2332 | 2338 | | |
2333 | 2339 | | |
2334 | 2340 | | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
2335 | 2349 | | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
2336 | 2368 | | |
2337 | 2369 | | |
2338 | 2370 | | |
| |||
0 commit comments