lib/gitlab_git/repository.rb in gitlab_git-7.1.6 vs lib/gitlab_git/repository.rb in gitlab_git-7.1.7

- old
+ new

@@ -97,10 +97,14 @@ def empty? rugged.empty? end + def bare? + rugged.bare? + end + def repo_exists? !!rugged end # Discovers the default branch based on the repository's available branches @@ -157,11 +161,11 @@ FileUtils.mkdir_p File.dirname(file_path) pid_file_path = archive_pid_file_path(ref, storage_path, format) return file_path if File.exist?(pid_file_path) - + File.open(pid_file_path, "w") do |file| file.puts Process.pid end # Create the archive in temp file, to avoid leaving a corrupt archive @@ -187,11 +191,11 @@ def archive_file_path(ref, storage_path, format = "tar.gz") ref ||= root_ref commit = Gitlab::Git::Commit.find(self, ref) return nil unless commit - extension = + extension = case format when "tar.bz2", "tbz", "tbz2", "tb2", "bz2" ".tar.bz2" when "tar" ".tar" @@ -955,10 +959,10 @@ end def nice_process(pid) niced_process = %W(renice -n 20 -p #{pid}) - unless RUBY_PLATFORM.include?('darwin') + unless RUBY_PLATFORM.include?('darwin') || RUBY_PLATFORM.include?('freebsd') niced_process = %W(ionice -c 2 -n 7 -p #{pid}) + niced_process end niced_process end