diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 15:06:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 15:06:12 +0000 |
commit | 4f4dcd3c5d7a15b7eab5fa28e27482fa68c750a3 (patch) | |
tree | 75e1d73289b774a909461007406eb22b33989265 /lib/gitlab/shell.rb | |
parent | 2cf5eb1498d6613523b39a829eb00f76df17e781 (diff) | |
download | gitlab-ce-4f4dcd3c5d7a15b7eab5fa28e27482fa68c750a3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/shell.rb')
-rw-r--r-- | lib/gitlab/shell.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index 7dbed591b84..ec9b2a2022e 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -126,7 +126,13 @@ module Gitlab def mv_repository(storage, path, new_path) return false if path.empty? || new_path.empty? - !!mv_directory(storage, "#{path}.git", "#{new_path}.git") + Gitlab::Git::Repository.new(storage, "#{path}.git", nil, nil).rename("#{new_path}.git") + + true + rescue => e + Gitlab::Sentry.track_acceptable_exception(e, extra: { path: path, new_path: new_path, storage: storage }) + + false end # Fork repository to new path @@ -151,9 +157,13 @@ module Gitlab def remove_repository(storage, name) return false if name.empty? - !!rm_directory(storage, "#{name}.git") - rescue ArgumentError => e + Gitlab::Git::Repository.new(storage, "#{name}.git", nil, nil).remove + + true + rescue => e Rails.logger.warn("Repository does not exist: #{e} at: #{name}.git") # rubocop:disable Gitlab/RailsLogger + Gitlab::Sentry.track_acceptable_exception(e, extra: { path: name, storage: storage }) + false end |