summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCindy Pallares <cindy@gitlab.com>2018-11-05 19:05:50 -0500
committerCindy Pallares <cindy@gitlab.com>2018-11-05 19:10:35 -0500
commit13becf042617083d6d95507dd621934077370c5e (patch)
treeda94bfefdc4006c12d51bb0b314eb02f53ec8315
parent57bc28e7907cc5166030c10638a2c756cb45dcaa (diff)
downloadgitlab-ce-52480-error-createbundle-cmd-wait-failed-while-performing-a-backup-due-to-stale-worktrees.tar.gz
-rw-r--r--changelogs/unreleased/52480-error-createbundle-cmd-wait-failed-while-performing-a-backup-due-to-stale-worktrees.yml5
-rw-r--r--lib/backup/repository.rb1
2 files changed, 6 insertions, 0 deletions
diff --git a/changelogs/unreleased/52480-error-createbundle-cmd-wait-failed-while-performing-a-backup-due-to-stale-worktrees.yml b/changelogs/unreleased/52480-error-createbundle-cmd-wait-failed-while-performing-a-backup-due-to-stale-worktrees.yml
new file mode 100644
index 00000000000..32d8be1eb66
--- /dev/null
+++ b/changelogs/unreleased/52480-error-createbundle-cmd-wait-failed-while-performing-a-backup-due-to-stale-worktrees.yml
@@ -0,0 +1,5 @@
+---
+title: Clean stale worktrees before backup
+merge_request: 22701
+author:
+type: fixed
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index c8a5377bfa0..8aeca94a32a 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -85,6 +85,7 @@ module Backup
restore_repo_success = nil
if File.exist?(path_to_project_bundle)
begin
+ project.repository.clean_stale_repository_files
project.repository.create_from_bundle(path_to_project_bundle)
restore_custom_hooks(project)
restore_repo_success = true