From: Harald Nordgren Date: Sat, 03 Jan 2026 13:00:05 GMT Subject: Another look? Message-ID: <20260103130005.26640-1-haraldnordgren@gmail.com> In-Reply-To: <9d3407a6-7d88-4f30-9961-5b21b059e1b0@gmail.com> > You want to display the remote tracking ref that tracks ref on the remote > that we push to. When git pushes $branch to $remote it checks if any > of the push refspecs remote.$remote.push match $branch. If there is a > match then the branch name is mapped according to the refspec and that > it the ref that is updated in the remote repository. It then takes that > ref and checks the fetch refspecs remote.$remote.fetch and if it finds a > match it maps the ref we've pushed to a remote tracking ref in the local > repository. > > It looks like you can find where we would push a branch to with > remote_ref_for_branch() and you can map that to a remote tracking ref with > tracking_for_push_dest(). We could use branch_get_push() but does more > than just map the refs as it checks push.default to see whether "git push" > would actually push the branch. Thanks! I have updated the code and added a test for remapped refspec. With that said, I don't 100% understand what I'm doing with the refspecs, so maybe you can give it another review? Harald