summaryrefslogtreecommitdiff
path: root/lib/gitlab/git
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/bundle_file.rb2
-rw-r--r--lib/gitlab/git/commit.rb4
-rw-r--r--lib/gitlab/git/diff.rb2
-rw-r--r--lib/gitlab/git/hook_env.rb2
-rw-r--r--lib/gitlab/git/push.rb2
-rw-r--r--lib/gitlab/git/repository.rb6
6 files changed, 9 insertions, 9 deletions
diff --git a/lib/gitlab/git/bundle_file.rb b/lib/gitlab/git/bundle_file.rb
index 8384a436fcc..91f6d50c08f 100644
--- a/lib/gitlab/git/bundle_file.rb
+++ b/lib/gitlab/git/bundle_file.rb
@@ -23,7 +23,7 @@ module Gitlab
def check!
data = File.open(filename, 'r') { |f| f.read(MAGIC.size) }
- raise InvalidBundleError, 'Invalid bundle file' unless data == MAGIC
+ raise InvalidBundleError, _('Invalid bundle file') unless data == MAGIC
end
end
end
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb
index 5863815ca85..ac8657450c9 100644
--- a/lib/gitlab/git/commit.rb
+++ b/lib/gitlab/git/commit.rb
@@ -39,7 +39,7 @@ module Gitlab
#
def where(options)
repo = options.delete(:repo)
- raise 'Gitlab::Git::Repository is required' unless repo.respond_to?(:log)
+ raise _('Gitlab::Git::Repository is required') unless repo.respond_to?(:log)
repo.log(options)
end
@@ -180,7 +180,7 @@ module Gitlab
end
def initialize(repository, raw_commit, head = nil)
- raise "Nil as raw commit passed" unless raw_commit
+ raise _("Nil as raw commit passed") unless raw_commit
@repository = repository
@head = head
diff --git a/lib/gitlab/git/diff.rb b/lib/gitlab/git/diff.rb
index 74a4633424f..6309a00476c 100644
--- a/lib/gitlab/git/diff.rb
+++ b/lib/gitlab/git/diff.rb
@@ -146,7 +146,7 @@ module Gitlab
when Gitaly::CommitDelta
init_from_gitaly(raw_diff)
when nil
- raise "Nil as raw diff passed"
+ raise _("Nil as raw diff passed")
else
raise "Invalid raw diff type: #{raw_diff.class}"
end
diff --git a/lib/gitlab/git/hook_env.rb b/lib/gitlab/git/hook_env.rb
index 892a069a3b7..d19334fafe6 100644
--- a/lib/gitlab/git/hook_env.rb
+++ b/lib/gitlab/git/hook_env.rb
@@ -21,7 +21,7 @@ module Gitlab
def self.set(gl_repository, env)
return unless Gitlab::SafeRequestStore.active?
- raise "missing gl_repository" if gl_repository.blank?
+ raise _("missing gl_repository") if gl_repository.blank?
Gitlab::SafeRequestStore[:gitlab_git_env] ||= {}
Gitlab::SafeRequestStore[:gitlab_git_env][gl_repository] = whitelist_git_env(env)
diff --git a/lib/gitlab/git/push.rb b/lib/gitlab/git/push.rb
index b6577ba17f1..11073a12ba3 100644
--- a/lib/gitlab/git/push.rb
+++ b/lib/gitlab/git/push.rb
@@ -44,7 +44,7 @@ module Gitlab
def modified_paths
unless branch_updated?
- raise ArgumentError, 'Unable to calculate modified paths!'
+ raise ArgumentError, _('Unable to calculate modified paths!')
end
strong_memoize(:modified_paths) do
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 786c90f9272..63521580555 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -449,7 +449,7 @@ module Gitlab
# Returns a RefName for a given SHA
def ref_name_for_sha(ref_path, sha)
- raise ArgumentError, "sha can't be empty" unless sha.present?
+ raise ArgumentError, _("sha can't be empty") unless sha.present?
gitaly_ref_client.find_ref_name(sha, ref_path)
end
@@ -854,7 +854,7 @@ module Gitlab
return unless full_path.present?
# This guard avoids Gitaly log/error spam
- raise NoRepository, 'repository does not exist' unless exists?
+ raise NoRepository, _('repository does not exist') unless exists?
set_config('gitlab.fullpath' => full_path)
end
@@ -971,7 +971,7 @@ module Gitlab
def checksum
# The exists? RPC is much cheaper, so we perform this request first
- raise NoRepository, "Repository does not exists" unless exists?
+ raise NoRepository, _("Repository does not exists") unless exists?
gitaly_repository_client.calculate_checksum
rescue GRPC::NotFound