Branch list shows latest pipeline for the commit not the branch.

Related to Tag list page links to latest pipeline of the c... (#347526)

When viewing the branches page we display a ci status icon next to each branch. The logic currently fetches this by finding the commit the branch points at and finds the latest pipeline for it. This of course means that if another branch or tag runs a pipeline for the commit we would see that one. We should be using the ref and sha value to locate the correct pipeline