Commit 2ad723e1c19fbced977964a055adeb4cd1dc5995

Authored by Angus MacArthur
1 parent 75fbdc40

fixed broken gitlab version determination during backup

If the backup directory is not sub the gitlab install directory,
then the git rev-parse call will fail.
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
lib/tasks/gitlab/backup.rake
... ... @@ -11,8 +11,6 @@ namespace :gitlab do
11 11 Rake::Task["gitlab:backup:repo:create"].invoke
12 12 Rake::Task["gitlab:backup:uploads:create"].invoke
13 13  
14   - Dir.chdir(Gitlab.config.backup.path)
15   -
16 14 # saving additional informations
17 15 s = {}
18 16 s[:db_version] = "#{ActiveRecord::Migrator.current_version}"
... ... @@ -20,6 +18,8 @@ namespace :gitlab do
20 18 s[:gitlab_version] = %x{git rev-parse HEAD}.gsub(/\n/,"")
21 19 s[:tar_version] = %x{tar --version | head -1}.gsub(/\n/,"")
22 20  
  21 + Dir.chdir(Gitlab.config.backup.path)
  22 +
23 23 File.open("#{Gitlab.config.backup.path}/backup_information.yml", "w+") do |file|
24 24 file << s.to_yaml.gsub(/^---\n/,'')
25 25 end
... ...