From c70f7ec77bdf8469bcb64ba3b235d68320280b9c Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Tue, 11 Jun 2019 16:11:21 +0200 Subject: [PATCH] Rename `BatchCommitLoader` to `BatchLfsOidLoader` Since we're not actually loading commits in that loader, but we're loading blobs with LFS oids in batch and returning only the oids. --- app/graphql/types/tree/blob_type.rb | 2 +- .../loaders/{batch_commit_loader.rb => batch_lfs_oid_loader.rb} | 2 +- ...batch_commit_loader_spec.rb => batch_lfs_oid_loader_spec.rb} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename lib/gitlab/graphql/loaders/{batch_commit_loader.rb => batch_lfs_oid_loader.rb} (95%) rename spec/lib/gitlab/graphql/loaders/{batch_commit_loader_spec.rb => batch_lfs_oid_loader_spec.rb} (93%) diff --git a/app/graphql/types/tree/blob_type.rb b/app/graphql/types/tree/blob_type.rb index ba191b59132..760781f3612 100644 --- a/app/graphql/types/tree/blob_type.rb +++ b/app/graphql/types/tree/blob_type.rb @@ -10,7 +10,7 @@ module Types field :web_url, GraphQL::STRING_TYPE, null: true field :lfs_oid, GraphQL::STRING_TYPE, null: true, resolve: -> (blob, args, ctx) do - Gitlab::Graphql::Loaders::BatchCommitLoader.new(blob.repository, blob.id).find + Gitlab::Graphql::Loaders::BatchLfsOidLoader.new(blob.repository, blob.id).find end end end diff --git a/lib/gitlab/graphql/loaders/batch_commit_loader.rb b/lib/gitlab/graphql/loaders/batch_lfs_oid_loader.rb similarity index 95% rename from lib/gitlab/graphql/loaders/batch_commit_loader.rb rename to lib/gitlab/graphql/loaders/batch_lfs_oid_loader.rb index f410c3195f8..8f34e58a771 100644 --- a/lib/gitlab/graphql/loaders/batch_commit_loader.rb +++ b/lib/gitlab/graphql/loaders/batch_lfs_oid_loader.rb @@ -3,7 +3,7 @@ module Gitlab module Graphql module Loaders - class BatchCommitLoader + class BatchLfsOidLoader def initialize(repository, blob_id) @repository, @blob_id = repository, blob_id end diff --git a/spec/lib/gitlab/graphql/loaders/batch_commit_loader_spec.rb b/spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb similarity index 93% rename from spec/lib/gitlab/graphql/loaders/batch_commit_loader_spec.rb rename to spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb index 0137b1029cd..46dd1777285 100644 --- a/spec/lib/gitlab/graphql/loaders/batch_commit_loader_spec.rb +++ b/spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Graphql::Loaders::BatchCommitLoader do +describe Gitlab::Graphql::Loaders::BatchLfsOidLoader do include GraphqlHelpers set(:project) { create(:project, :repository) }