Branch Divergence graph message does not refer to the default branch

Summary

The Branch Divergence graph on the Branches list page always reads "x commits behind master, y commits ahead", regardless of wether the default branch is master or not.

Steps to reproduce

  1. Create new empty project and make an initial commit.
  2. Create a new branch and make a commit.
  3. Change the default branch of the project to the new branch.
  4. Go to The Repository->Branches page.
  5. Hover over the divergence graph of the master branch, it will read "1 commits behind master, 0 commits ahead"

Example Project

https://gitlab.com/0neblock/test-branch-divergence-project

What is the current bug behavior?

The divergent message shows the master branch, even it it is not the default branch.

What is the expected correct behavior?

The message should show the default branch.

Relevant logs and/or screenshots

Screen_Shot_2019-09-05_at_12.26.43_pm

Possible fixes

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/branches/divergence_graph.js

This file has 'master' hardcoded for the DivergenceGraph Vue component, it should instead pass the name of the default branch.

Assignee Loading
Time tracking Loading