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
This commit is contained in:
commit
d65d5c2d1a
|
@ -43,6 +43,9 @@ v 8.7.0 (unreleased)
|
|||
- 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
|
||||
|
|
|
@ -896,9 +896,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
|
||||
|
|
Loading…
Reference in New Issue