fix(updatenotification): fix ref diff parsing for fetch --dry-run#4138
Merged
khassel merged 1 commit intoMagicMirrorOrg:developfrom May 3, 2026
Merged
fix(updatenotification): fix ref diff parsing for fetch --dry-run#4138khassel merged 1 commit intoMagicMirrorOrg:developfrom
khassel merged 1 commit intoMagicMirrorOrg:developfrom
Conversation
The regex used to extract the commit range from fetch dry-run output matched the full line, including the branch name. This caused git rev-list to receive an ambiguous argument (e.g. "60e0377..332e429 develop" instead of "60e0377..332e429"), breaking update checks. Replace regex-based parsing with token-based line parsing that extracts only the first whitespace-delimited token, with a fallback to <branch>..origin/<branch> when fetch reports no changes. Add unit tests for the new parsing helper and correct existing test snapshots that previously encoded the broken behavior.
khassel
approved these changes
May 3, 2026
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.
The regex captured the full fetch output line including the branch name. Before #4115, the command was built as a shell string, so the shell split the arguments correctly. After #4115 switched to
execFile, the range and branch name were passed as a single argument (60e0377..332e429 develop) - which git rejects as ambiguous.The fix replaces the regex with column-based line parsing: find the line for the current branch, take the first column. Falls back to
<branch>..origin/<branch>when fetch reports no changes (same behavior as before).Also adds unit tests for the new helper and corrects existing test snapshots that encoded the broken behavior.
Fixes #4137.