Commit 73af10c1 authored by Valery Sizov's avatar Valery Sizov

Fix: Geo: BaseSyncService should prune the @geo-temporary directory before fetching

parent 976e2e11
......@@ -220,7 +220,7 @@ module Geo
end
def clean_up_temporary_repository
exists = gitlab_shell.exists?(project.repository_storage, disk_path_temp)
exists = gitlab_shell.exists?(project.repository_storage, disk_path_temp + '.git')
if exists && !gitlab_shell.remove_repository(project.repository_storage, disk_path_temp)
raise Gitlab::Shell::Error, "Temporary #{type} can not be removed"
......
---
title: 'Fix: Geo: BaseSyncService should prune the @geo-temporary directory before
fetching'
merge_request:
author:
type: fixed
......@@ -299,7 +299,8 @@ describe Geo::RepositorySyncService do
)
expect(subject).to receive(:fetch_geo_mirror)
expect(subject).to receive(:clean_up_temporary_repository).twice
expect(subject).to receive(:clean_up_temporary_repository).twice.and_call_original
expect(subject.gitlab_shell).to receive(:exists?).twice.with(project.repository_storage, /.git$/)
subject.execute
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment