Skip to content

Commit

Permalink
When stripping options, clear options if no fields remain and also cl…
Browse files Browse the repository at this point in the history
…ear source code info (#251)

This updates the recently added
`options.StripSourceRetentionOptionsFromFile` so it is more thorough:
1. We were previously failing to strip source code locations for the
removed options. So now those are removed, too.
2. If we end up removing _all_ fields from an options message, set the
descriptor's options field to nil (effectively clearing it entirely,
instead of leaving it an empty message).

This now matches the output of `protoc` when it strips options.
  • Loading branch information
jhump authored Mar 8, 2024
1 parent 8727154 commit fa65418
Show file tree
Hide file tree
Showing 2 changed files with 440 additions and 61 deletions.
Loading

0 comments on commit fa65418

Please sign in to comment.