summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/git/commit_spec.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-06-05 17:58:28 +0200
committerJacob Vosmaer <jacob@gitlab.com>2018-06-12 14:33:37 +0200
commitf376347f24f24efc157d80de63381dd22d060630 (patch)
tree73dc59fbab206b2c5e79e6144b4d02c931da92a0 /spec/lib/gitlab/git/commit_spec.rb
parentb2ef7f6cd9b98681aeb2274e29f0b3aaac423fc9 (diff)
downloadgitlab-ce-f376347f24f24efc157d80de63381dd22d060630.tar.gz
Find and mark more Git disk access locations, part 2
Diffstat (limited to 'spec/lib/gitlab/git/commit_spec.rb')
-rw-r--r--spec/lib/gitlab/git/commit_spec.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb
index 89be8a1b7f2..5af982c7a54 100644
--- a/spec/lib/gitlab/git/commit_spec.rb
+++ b/spec/lib/gitlab/git/commit_spec.rb
@@ -4,12 +4,15 @@ describe Gitlab::Git::Commit, seed_helper: true do
let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '') }
let(:commit) { described_class.find(repository, SeedRepo::Commit::ID) }
let(:rugged_commit) do
- repository.rugged.lookup(SeedRepo::Commit::ID)
+ Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ repository.rugged.lookup(SeedRepo::Commit::ID)
+ end
end
-
describe "Commit info" do
before do
- repo = Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '').rugged
+ repo = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '').rugged
+ end
@committer = {
email: 'mike@smith.com',
@@ -58,7 +61,9 @@ describe Gitlab::Git::Commit, seed_helper: true do
after do
# Erase the new commit so other tests get the original repo
- repo = Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '').rugged
+ repo = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '').rugged
+ end
repo.references.update("refs/heads/master", SeedRepo::LastCommit::ID)
end
end
@@ -115,7 +120,9 @@ describe Gitlab::Git::Commit, seed_helper: true do
describe '.find' do
it "should return first head commit if without params" do
expect(described_class.last(repository).id).to eq(
- repository.rugged.head.target.oid
+ Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ repository.rugged.head.target.oid
+ end
)
end