summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-02-15 11:13:24 +0000
committerDouwe Maan <douwe@gitlab.com>2018-02-15 11:13:24 +0000
commitf3003d130663f3b10982deac10f9572d89db417b (patch)
treeeb8212f4500af4cd20c0467608e4e8f5a6aa77ee /app
parent1b980874c6d964a2914f99b6c9d748dcd86409f2 (diff)
parent850689081820d0fcf466bb76c17d182b59e0b416 (diff)
downloadgitlab-ce-f3003d130663f3b10982deac10f9572d89db417b.tar.gz
Merge branch 'sh-fix-error-500-licensee' into 'master'
Fix Error 500s loading repositories with inconsistent HEAD Closes #43268 See merge request gitlab-org/gitlab-ce!17128
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 1cf55fd4332..4f754b11da4 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -593,7 +593,15 @@ class Repository
def license_key
return unless exists?
- Licensee.license(path).try(:key)
+ # The licensee gem creates a Rugged object from the path:
+ # https://github.com/benbalter/licensee/blob/v8.7.0/lib/licensee/projects/git_project.rb
+ begin
+ Licensee.license(path).try(:key)
+ # Normally we would rescue Rugged::Error, but that is banned by lint-rugged
+ # and we need to migrate this endpoint to Gitaly:
+ # https://gitlab.com/gitlab-org/gitaly/issues/1026
+ rescue
+ end
end
cache_method :license_key