Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-04 01:23:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-04 01:23:33 +0300
commit6c3124c854cbeef391a38b5ae8330174d78348bf (patch)
treeaf77629bc34ccc517ed24d9db35895be5d02d23d /lib/backup
parent9a8ae3b4e90e56f71bb770463b943512efdcd1d1 (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-ee
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/gitaly_backup.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/backup/gitaly_backup.rb b/lib/backup/gitaly_backup.rb
index a8b0e7ad157..077eabdd131 100644
--- a/lib/backup/gitaly_backup.rb
+++ b/lib/backup/gitaly_backup.rb
@@ -19,6 +19,10 @@ module Backup
def start(type, backup_repos_path, backup_id: nil)
raise Error, 'already started' if started?
+ if type == :create && !incremental?
+ FileUtils.rm_rf(backup_repos_path)
+ end
+
command = case type
when :create
'create'
@@ -34,7 +38,7 @@ module Backup
if Feature.enabled?(:incremental_repository_backup)
args += ['-layout', 'pointer']
if type == :create
- args += ['-incremental'] if @incremental
+ args += ['-incremental'] if incremental?
args += ['-id', backup_id] if backup_id
end
end
@@ -68,6 +72,10 @@ module Backup
private
+ def incremental?
+ @incremental
+ end
+
# Schedule a new backup job through a non-blocking JSON based pipe protocol
#
# @see https://gitlab.com/gitlab-org/gitaly/-/blob/master/doc/gitaly-backup.md