This repository was archived by the owner on May 12, 2018. It is now read-only.
Commit befc0e2
Douwe Maan
Merge branch 'fix-invalid-symbolic-ref' into 'master'
Ignore symbolic refs that point to deleted branches
While trying to test another bug, I deleted a branch that happened to have a symbolic ref pointing to it. I wasn't able to even reach the GitLab dashboard as a result. The error that showed up:
```
Rugged::ReferenceError - Reference 'refs/heads/new-branch' not found:
gitlab_git (7.2.6) lib/gitlab_git/repository.rb:56:in `block in branches'
gitlab_git (7.2.6) lib/gitlab_git/repository.rb:55:in `branches'
gitlab_git (7.2.6) lib/gitlab_git/repository.rb:50:in `branch_names'
gitlab_git (7.2.6) lib/gitlab_git/repository.rb:116:in `discover_default_branch'
gitlab_git (7.2.6) lib/gitlab_git/repository.rb:33:in `initialize'
app/models/repository.rb:11:in `initialize'
app/models/project.rb:263:in `repository'
app/models/project.rb:426:in `avatar_in_git'
app/models/project.rb:435:in `avatar_url'
app/helpers/application_helper.rb:41:in `project_icon'
app/views/shared/_project.html.haml:5:in `block (2 levels) in _app_views_shared__project_html_haml__222087319794829046_70255909387840'
haml (4.0.5) lib/haml/helpers.rb:368:in `block in capture_haml'
haml (4.0.5) lib/haml/helpers.rb:608:in `with_haml_buffer'
haml (4.0.5) lib/haml/helpers.rb:364:in `capture_haml'
haml (4.0.5) lib/haml/helpers/xss_mods.rb:61:in `capture_haml_with_haml_xss'
haml (4.0.5) lib/haml/helpers/action_view_mods.rb:45:in `capture_with_haml'
```
The repository had this state:
```
$ git branch -a
* master
test
test-symlink -> new-branch
```
See merge request !33File tree
5 files changed
+27
-2
lines changed- lib/gitlab_git
- spec
5 files changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
640 | 653 | | |
0 commit comments