summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-04-12 15:34:56 +0000
committerRémy Coutable <remy@rymai.me>2016-04-15 18:04:34 +0200
commit6ef1adc7274c98f3723e325c2a4be796c67515a4 (patch)
treece233110e426ea701fa86054a21d30afae1febaf
parente63f120e9a8d155443b894a334dd4a57eee6fa5d (diff)
downloadgitlab-ce-6ef1adc7274c98f3723e325c2a4be796c67515a4.tar.gz
Merge branch 'feature/fix-14753' into 'master'
Fix #14753: Check if head is born before trying to detect main language This MR makes sure that head exists before trying to detect the main language. This prevents errors on repo's without a master branch. Closes #14753 See merge request !3654
-rw-r--r--CHANGELOG46
-rw-r--r--app/models/repository.rb6
2 files changed, 49 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fe1cc494db1..3670a18b3d1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,51 @@
Please view this file on the master branch, on stable branches it's out of date.
+v 8.7.0 (unreleased)
+ - All service classes (those residing in app/services) are now instrumented (Yorick Peterse)
+ - Enable gzip for assets, makes the page size significantly smaller. !3544 / !3632 (Connor Shea)
+ - Load award emoji images separately unless opening the full picker. Saves several hundred KBs of data for most pages. (Connor Shea)
+ - All images in discussions and wikis now link to their source files !3464 (Connor Shea).
+ - Return status code 303 after a branch DELETE operation to avoid project deletion (Stan Hu)
+ - Improved Markdown rendering performance !3389 (Yorick Peterse)
+ - Don't attempt to look up an avatar in repo if repo directory does not exist (Stan Hu)
+ - Expose project badges in project settings
+ - Preserve time notes/comments have been updated at when moving issue
+ - Make HTTP(s) label consistent on clone bar (Stan Hu)
+ - Expose label description in API (Mariusz Jachimowicz)
+ - Allow back dating on issues when created through the API
+ - Fix Error 500 after renaming a project path (Stan Hu)
+ - Fix avatar stretching by providing a cropping feature
+ - API: Expose `subscribed` for issues and merge requests (Robert Schilling)
+ - Allow SAML to handle external users based on user's information !3530
+ - Add endpoints to archive or unarchive a project !3372
+ - Add links to CI setup documentation from project settings and builds pages
+ - Handle nil descriptions in Slack issue messages (Stan Hu)
+ - API: Expose open_issues_count, closed_issues_count, open_merge_requests_count for labels (Robert Schilling)
+ - Add default scope to projects to exclude projects pending deletion
+ - Ensure empty recipients are rejected in BuildsEmailService
+ - API: Ability to filter milestones by state `active` and `closed` (Robert Schilling)
+ - API: Fix milestone filtering by `iid` (Robert Schilling)
+ - API: Delete notes of issues, snippets, and merge requests (Robert Schilling)
+ - Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
+ - Better errors handling when creating milestones inside groups
+ - Hide `Create a group` help block when creating a new project in a group
+ - Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
+ - Gracefully handle notes on deleted commits in merge requests (Stan Hu)
+ - Fix creation of merge requests for orphaned branches (Stan Hu)
+ - API: Ability to retrieve a single tag (Robert Schilling)
+ - Fall back to `In-Reply-To` and `References` headers when sub-addressing is not available (David Padilla)
+ - Remove "Congratulations!" tweet button on newly-created project. (Connor Shea)
+ - Fix admin/projects when using visibility levels on search (PotHix)
+ - Build status notifications
+ - API: Expose user location (Robert Schilling)
+ - ClosingIssueExtractor regex now also works with colons. e.g. "Fixes: #1234" !3591
+ - Update number of Todos in the sidebar when it's marked as "Done". !3600
+ - API: Expose 'updated_at' for issue, snippet, and merge request notes (Robert Schilling)
+ - API: User can leave a project through the API when not master or owner. !3613
+
+v 8.6.6
+ - Fix error on language detection when repository has no HEAD (e.g., master branch). !3654 (Jeroen Bobbeldijk)
+
v 8.6.5
- Fix importing from GitHub Enterprise. !3529
- Perform the language detection after updating merge requests in `GitPushService`, leading to faster visual feedback for the end-user. !3533
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 1e4223cee9d..f8006dff227 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -888,9 +888,9 @@ class Repository
end
def main_language
- unless empty?
- Linguist::Repository.new(rugged, rugged.head.target_id).language
- end
+ return if empty? || rugged.head_unborn?
+
+ Linguist::Repository.new(rugged, rugged.head.target_id).language
end
def avatar