Skip to content

Commit f93c18a

Browse files
authored
Fix shared module read bucket for proto file refs and include_package_files (#3512)
1 parent 880faed commit f93c18a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

private/bufpkg/bufmodule/module_read_bucket.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,12 @@ func (b *moduleReadBucket) getIsTargetFileForPathUncached(ctx context.Context, p
543543
// We've now deferred having to get fastscan.Results as much as we can.
544544
protoFileTargetFastscanResult, err := b.getFastscanResultForPath(ctx, b.protoFileTargetPath)
545545
if err != nil {
546+
// In the case where multiple modules may have shared module roots through the includes key
547+
// in the module configs, the protoFileTargetPath may not exist in the target module.
548+
// In that case, we just return false.
549+
if errors.Is(err, fs.ErrNotExist) {
550+
return false, nil
551+
}
546552
return false, err
547553
}
548554
if protoFileTargetFastscanResult.PackageName == "" {

0 commit comments

Comments
 (0)