From c5d97c7e37fbfc4ed478da24d64d54c770ed2097 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Sat, 19 Sep 2015 13:33:28 +0200 Subject: [PATCH] COPYING is now also accepted as licence file Fixes #2526 --- CHANGELOG | 2 ++ app/models/repository.rb | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 31feb115d1e..f078d08d86b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -90,6 +90,8 @@ v 8.0.1 v 8.0.0 - Fix Markdown links not showing up in dashboard activity feed (Stan Hu) - Remove milestones from merge requests when milestones are deleted (Stan Hu) +v 8.0.0 (unreleased) + - Accept COPYING as licence file (Zeger-Jan van de Weg) - Fix HTML link that was improperly escaped in new user e-mail (Stan Hu) - Fix broken sort in merge request API (Stan Hu) - Bump rouge to 1.10.1 to remove warning noise and fix other syntax highlighting bugs (Stan Hu) diff --git a/app/models/repository.rb b/app/models/repository.rb index 8b51602bc23..cc46ab916c7 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -210,9 +210,9 @@ class Repository def license cache.fetch(:license) do - tree(:head).blobs.find do |file| - file.name =~ /\Alicense/i - end + tree(:head).blobs.find_all do |file| + file.name =~ /\A(copying|license)/i + end.last # Prefer `LICENSE` as filename over `COPYING` end end