summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-06-08 15:27:10 +0200
committerJacob Vosmaer <jacob@gitlab.com>2018-06-08 15:27:10 +0200
commitf99cdef492b9fc0e0f995d144292fb400794af6f (patch)
tree8a83261fb7e9da34607ce87da4184ffd45a28609
parentf6c79564baae71487080e62b1bcc2ef628f33150 (diff)
downloadgitlab-ce-f99cdef492b9fc0e0f995d144292fb400794af6f.tar.gz
rubocop
-rw-r--r--lib/gitlab/shell.rb15
-rw-r--r--spec/lib/gitlab/git/blob_spec.rb1
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb
index f6d82742e2b..55ea4333d57 100644
--- a/lib/gitlab/shell.rb
+++ b/lib/gitlab/shell.rb
@@ -106,14 +106,13 @@ module Gitlab
raise Error.new("don't use disk paths with import_repository: #{url.inspect}")
end
- cmd = nil
relative_path = "#{name}.git"
- Gitlab::GitalyClient.migrate(:import_repository, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
+ cmd = Gitlab::GitalyClient.migrate(:import_repository, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled
- cmd = GitalyGitlabProjects.new(storage, relative_path)
+ GitalyGitlabProjects.new(storage, relative_path)
else
# The timeout ensures the subprocess won't hang forever
- cmd = gitlab_projects(storage, relative_path)
+ gitlab_projects(storage, relative_path)
end
end
success = cmd.import_project(url, git_timeout)
@@ -123,7 +122,6 @@ module Gitlab
success
end
-
# Fetch remote for repository
#
# repository - an instance of Git::Repository
@@ -174,15 +172,14 @@ module Gitlab
#
# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/817
def fork_repository(forked_from_storage, forked_from_disk_path, forked_to_storage, forked_to_disk_path)
- cmd = nil
forked_from_relative_path = "#{forked_from_disk_path}.git"
- Gitlab::GitalyClient.migrate(:fork_repository,
+ cmd = Gitlab::GitalyClient.migrate(:fork_repository,
status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled
- cmd = GitalyGitlabProjects.new(forked_from_storage, forked_from_relative_path)
+ GitalyGitlabProjects.new(forked_from_storage, forked_from_relative_path)
else
- cmd = gitlab_projects(forked_from_storage, forked_from_relative_path)
+ gitlab_projects(forked_from_storage, forked_from_relative_path)
end
end
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb
index bea08ff5a0f..6015086f002 100644
--- a/spec/lib/gitlab/git/blob_spec.rb
+++ b/spec/lib/gitlab/git/blob_spec.rb
@@ -170,7 +170,6 @@ describe Gitlab::Git::Blob, seed_helper: true do
repository.rugged.rev_parse('master^{tree}')
end
-
blob = Gitlab::Git::Blob.raw(repository, tree.oid)
expect(blob).to be_nil