diff options
author | Luke Duncalfe <lduncalfe@gitlab.com> | 2019-06-19 20:51:57 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-06-19 20:51:57 +0300 |
commit | dcf811ba147a9d1c677fa626ca06639783d09717 (patch) | |
tree | 6e114055074385c4d057be651783134ab7b0f6ee /lib/gitlab/git | |
parent | 96c2949d6cfae23571f7d24c7b5ad1c22d759670 (diff) |
CE backport for changes in EE MR 14017
This backports to CE changes to allow the EE model
DesignManagement::Repository to override the #attributes_at method to
provide its own git attributes.
The #attributes_at method was freely available, as it's never called by
anything in the app. It looks like the code that called it got
refactored out of existence in ca66a04f. It was still being called in a
spec
https://gitlab.com/gitlab-org/gitlab-ce/blob/85b29c1c2fa3b94d7371cf454c485457a0756cb1/spec/services/files/create_service_spec.rb#L40
which I've left because with the change in Lfs::FileTransformer in fact
is now again the perfect test!
See EE MR
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14017
And these comment threads
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178002089
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178049984
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r-- | lib/gitlab/git/repository.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 8a2e711ec4e..a6739f12280 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -683,17 +683,16 @@ module Gitlab attributes(path)[name] end - # Check .gitattributes for a given ref + # Returns parsed .gitattributes for a given ref # - # This only checks the root .gitattributes file, + # This only parses the root .gitattributes file, # it does not traverse subfolders to find additional .gitattributes files # # This method is around 30 times slower than `attributes`, which uses # `$GIT_DIR/info/attributes`. Consider caching AttributesAtRefParser # and reusing that for multiple calls instead of this method. - def attributes_at(ref, file_path) - parser = AttributesAtRefParser.new(self, ref) - parser.attributes(file_path) + def attributes_at(ref) + AttributesAtRefParser.new(self, ref) end def languages(ref = nil) |