Error viewing branches list containing a symbolic reference
Basically we "sort of" support symbolic references now, but there are some places in the code that it fails (sorting branches):
https://gitlab.com/gitlab-org/gitlab-ee/blob/v10.8.7-ee/lib/gitlab/git/repository.rb#L1976-1991
This fails because we don't have a
dereferenced_commit
.This breaks anywhere in the UI where we are not just sorting by name. Currently in the UI that the Branches page, the Branches drop down on the repository home page, BUT NOT the merge request creation page, that's sorted by name.
Steps to reproduce
- create repo
- create branch named
test-branch
- create symbolic ref via command line pointing to test-branch
- Try and load the branches page: /branches
This fails due to not having a dereferenced target:
NoMethodError (undefined method `committed_date' for nil:NilClass):
lib/gitlab/git/repository.rb:1982:in `block in sort_branches'
lib/gitlab/git/repository.rb:1981:in `sort'
lib/gitlab/git/repository.rb:1981:in `sort_branches'
lib/gitlab/git/repository.rb:1779:in `branches_filter'
lib/gitlab/git/repository.rb:207:in `block in local_branches'
https://gitlab.com/gitlab-org/gitlab-ee/blob/v10.8.7-ee/lib/gitlab/git/repository.rb#L1976-1991
Links / references
Edited by James Ramsay (ex-GitLab)