gitlab-org--gitlab-foss/spec
Valery Sizov bbbcc9657f Merge branch 'fix-error-500-when-no-head' into 'master'
Fix error 500 when no HEAD is available

Steps to reproduce:

1. Create a project with a README
2. In the actual remote, type: `git symbolic-ref HEAD refs/heads/nowhere`
3. Check that HEAD is gone via `git ls-remote .`
4. Go to the projects page and see the Error 500

Error:

```
NoMethodError - undefined method `sha' for nil:NilClass:
  app/helpers/projects_helper.rb:281:in `readme_cache_key'
  app/views/projects/_readme.html.haml:10:in `_app_views_projects__readme_html_haml___2036282917939462960_70154565285700'
  actionview (4.1.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `instrument'
  actionview (4.1.11) lib/action_view/template.rb:339:in `instrument'
  actionview (4.1.11) lib/action_view/template.rb:143:in `render'
  rack-mini-profiler (0.9.0) lib/mini_profiler/profiling_methods.rb:108:in `block in profile_method'
  actionview (4.1.11) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
  actionview (4.1.11) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
  actionview (4.1.11) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `instrument'
  actionview (4.1.11) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionview (4.1.11) lib/action_view/renderer/partial_renderer.rb:278:in `render'
  actionview (4.1.11) lib/action_view/renderer/renderer.rb:47:in `render_partial'
  actionview (4.1.11) lib/action_view/helpers/rendering_helper.rb:35:in `render'
  haml (4.0.5) lib/haml/helpers/action_view_mods.rb:10:in `block in render_with_haml'
  haml (4.0.5) lib/haml/helpers.rb:89:in `non_haml'
  haml (4.0.5) lib/haml/helpers/action_view_mods.rb:10:in `render_with_haml'
  app/views/projects/show.html.haml:47:in `_app_views_projects_show_html_haml__1458303859692972698_70154948164180'
  actionview (4.1.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.1.11) lib/active_support/notifications.rb:159:in `block in instrument'
```

Closes https://github.com/gitlabhq/gitlabhq/issues/9484, but there may be some other issue there.

See merge request !1041
2015-07-24 20:18:14 +00:00
..
controllers Merge branch 'rs-issue-2012' into 'master' 2015-07-24 09:29:58 +00:00
factories Fix Style/AsciiComments cop violation 2015-06-22 14:43:51 -04:00
features Move spec/features/admin/security_spec to spec/features/security 2015-07-22 00:39:18 -04:00
finders Set milestone on new issue when creating issue from index with milestone filter active. 2015-05-27 14:22:11 +02:00
fixtures GoogleCode importer: Do not care about casing of image file extensions 2015-07-20 00:53:43 +02:00
helpers Merge branch 'fix-error-500-when-no-head' into 'master' 2015-07-24 20:18:14 +00:00
javascripts Add test case for clicking line number anchor icon 2015-07-17 20:40:56 -04:00
lib GoogleCode importer: Do not care about casing of image file extensions 2015-07-20 00:53:43 +02:00
mailers Merge branch 'master' into rubocop-for-tests 2015-06-23 10:44:03 +02:00
models Add User.find_by_username! 2015-07-23 17:16:39 -04:00
requests/api Clearing the entire Redis cache may be too expensive; just use 2015-07-21 19:09:33 -07:00
routing Audit log for user authentication 2015-07-06 12:36:08 +03:00
services Update specs. 2015-07-11 16:47:33 -04:00
support Merge branch 'rs-security-spec-speed' into 'master' 2015-07-22 09:22:43 +00:00
tasks/gitlab Fix rubocop issues after merge of recent master 2015-06-23 10:46:29 +02:00
workers Merge branch 'master' into rubocop-for-tests 2015-06-23 10:44:03 +02:00
factories.rb Add User#disable_two_factor! 2015-07-10 16:18:30 -04:00
factories_spec.rb Remove the invalid key factories 2015-04-11 17:12:10 -04:00
rails_helper.rb Started on the actual rspec 3 upgrade 2015-06-22 12:12:49 +02:00
spec_helper.rb Move coverage-related setup back to spec_helper 2015-07-13 22:41:47 -04:00
teaspoon_env.rb teaspoon install 2015-05-28 18:22:32 -04:00