Repository navigation
fix(list): report the tracked remote branch in schema-1 JSON remote.branch - #4756
Merged
Merged
Conversation
…ranch Schema-1 `remote.branch` serialized the local branch name, so a local `feature` tracking `origin/other-name` reported "feature". UpstreamStatus has carried the upstream's short name since the field's comment was written; use the remote-side name, as schema 2's `upstream.branch` does, falling back to the local name only when the upstream name is unknown.
1 task
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.
wt list --format=json(schema 1) andwt list statusline --format=jsonreported the local branch name inremote.branch. So a localfeaturetrackingorigin/other-nameserialized"branch": "feature", even though the field is documented as the remote branch name. Schema 2'supstream.branchalready reportsother-namefor the same row, so the two schemas disagreed.upstream_to_jsonhas a comment sayingUpstreamStatusonly stores the remote name. That stopped being true once the field began carrying the upstream's short name (upstream_short, set incompute_upstream). The fix readsActiveUpstream::branch, which is the same value schema 2 uses. It falls back to the local name only when the upstream short name is unknown, so output for rows without one doesn't change.A new unit test (
test_upstream_to_json_reports_tracked_branch_name) fails onmainwithleft: "feature",right: "other-name"and passes with the fix. The existinglistandstatuslineintegration tests pass unchanged, because none of them track a remote branch under a different name.Found by the nightly survey.