Skip to content

fix(updatenotification): fix ref diff parsing for fetch --dry-run#4138

Merged
khassel merged 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO:update
May 3, 2026
Merged

fix(updatenotification): fix ref diff parsing for fetch --dry-run#4138
khassel merged 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO:update

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

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.

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 khassel merged commit 623e1e2 into MagicMirrorOrg:develop May 3, 2026
12 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the update branch May 6, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants