Repository navigation
fix(tool): preserve filenames in changed chart detection - #885
Merged
cpanato merged 1 commit intoNov 10, 2026
Merged
Conversation
Read NUL-delimited git diff output without trimming whitespace or mixing stderr into paths. Cover Unicode, whitespace and quoted filenames in a temporary Git repository. Signed-off-by: Виктор Быстров <anatema@bk.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Changed-chart detection consumes newline-separated
git diff --name-onlyoutput as literal paths. Git quotes Unicode and control characters by default, so paths such ascharts/café/values.yamlno longer name files in the checkout and can be skipped. The output helper also trims leading whitespace from the first path.Request NUL-delimited paths and read stdout without trimming it. Split only on NUL boundaries, preserving Unicode, quotes, tabs, newlines and leading spaces in filenames. Empty diffs and command errors keep their existing behavior.
Special notes for your reviewer:
The regression test uses a temporary Git repository with
core.quotepath=trueand compares against the empty tree. On unmodified main, six of the eight fixture paths are corrupted; with the fix the returned list matches all filenames exactly. It also covers an empty diff and an invalid revision. The fixture creates no commits.Validation with Go 1.27.3 and golangci-lint 2.14.0:
All passed.