diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-07-09 14:46:17 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-07-09 14:46:17 +0000 |
commit | 9a9b4444ac176dbfda8ed38653550931fe7671f3 (patch) | |
tree | 3cd76162beb032069e72cb8b5bc2e81537acc16b /lib | |
parent | e45dcbdca2276cc8e9d3dfb247380c6691c71be4 (diff) | |
parent | 31f2608161945d3c1189509955d68209934e2988 (diff) | |
download | gitlab-ce-9a9b4444ac176dbfda8ed38653550931fe7671f3.tar.gz |
Merge branch 'sh-fix-issue-47797-ce' into 'master'
Fix handling of annotated tags when Gitaly is not in use
Closes #47797
See merge request gitlab-org/gitlab-ce!20497
Diffstat (limited to 'lib')
-rw-r--r-- | lib/extracts_path.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index a9b04c183ad..e8dbde176ef 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -139,6 +139,11 @@ module ExtractsPath def lfs_blob_ids blob_ids = tree.blobs.map(&:id) + + # When current endpoint is a Blob then `tree.blobs` will be empty, it means we need to analyze + # the current Blob in order to determine if it's a LFS object + blob_ids = Array.wrap(@repo.blob_at(@commit.id, @path)&.id) if blob_ids.empty? # rubocop:disable Gitlab/ModuleWithInstanceVariables + @lfs_blob_ids = Gitlab::Git::Blob.batch_lfs_pointers(@project.repository, blob_ids).map(&:id) # rubocop:disable Gitlab/ModuleWithInstanceVariables end |