Commit 0b286515 authored by Nick Thomas's avatar Nick Thomas

Merge branch...

Merge branch '5841-geo-basesyncservice-should-prune-the-geo-temporary-directory-before-fetching' into 'master'

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

Closes #5841

See merge request gitlab-org/gitlab-ee!5543
parents a4e99887 73af10c1
......@@ -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