summaryrefslogtreecommitdiff
path: root/lib/backup/repository.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-22 12:18:40 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:32:42 -0600
commit87c9df29ce8835da5d68dbf3e59674bd4524ee96 (patch)
tree0db8fb3fdda766f312441729d003b68ced7b2fa5 /lib/backup/repository.rb
parente2bbbb1a9aea72e4313cdc257460eb416fe8dc0b (diff)
downloadgitlab-ce-87c9df29ce8835da5d68dbf3e59674bd4524ee96.tar.gz
Don’t exclude some file in lib from rubocop
Diffstat (limited to 'lib/backup/repository.rb')
-rw-r--r--lib/backup/repository.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index 91e43dcb114..d16d5ba4960 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -2,7 +2,7 @@ require 'yaml'
module Backup
class Repository
-
+ # rubocop:disable Metrics/AbcSize
def dump
prepare
@@ -85,11 +85,11 @@ module Backup
project.ensure_dir_exist
- if File.exists?(path_to_project_bundle)
- cmd = %W(#{Gitlab.config.git.bin_path} clone --bare #{path_to_project_bundle} #{path_to_project_repo})
- else
- cmd = %W(#{Gitlab.config.git.bin_path} init --bare #{path_to_project_repo})
- end
+ cmd = if File.exist?(path_to_project_bundle)
+ %W(#{Gitlab.config.git.bin_path} clone --bare #{path_to_project_bundle} #{path_to_project_repo})
+ else
+ %W(#{Gitlab.config.git.bin_path} init --bare #{path_to_project_repo})
+ end
output, status = Gitlab::Popen.popen(cmd)
if status.zero?
@@ -150,6 +150,7 @@ module Backup
puts output
end
end
+ # rubocop:enable Metrics/AbcSize
protected
@@ -193,7 +194,7 @@ module Backup
end
def silent
- {err: '/dev/null', out: '/dev/null'}
+ { err: '/dev/null', out: '/dev/null' }
end
private