fix: support arbitrary whitespace in _forgit_parse_array#541
fix: support arbitrary whitespace in _forgit_parse_array#541carlfriedrich wants to merge 1 commit into
Conversation
Values spanning multiple lines (e.g. a multi-line FORGIT_*_GIT_OPTS export) were silently dropped: read stopped at the first newline and IFS only split on spaces, so the resulting array came out empty. Split on spaces, tabs and newlines and consume the whole value with an empty delimiter, ignoring leading/trailing whitespace. Add unit tests covering space-, tab- and newline-separated inputs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
Changes_forgit_parse_array whitespace splitting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Config variable values spanning multiple lines were silently dropped: read stopped at the first newline and IFS only split on spaces, so the resulting array came out empty.
Example:
This resulted in an empty options array before. This PR fixes this and also adds corresponding unit tests (failing before the fix, now green).
Check list
Description
Type of change
Test environment
Summary by CodeRabbit
Bug Fixes
Tests