From 7354c9f75dfbf4c495d2869b5dd4f0dd4f5c9612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Wed, 20 Dec 2017 16:54:09 -0300 Subject: Remove unused method `remote_exists?` --- app/models/repository.rb | 4 ---- lib/gitlab/git/repository.rb | 5 ----- spec/lib/gitlab/git/repository_spec.rb | 15 --------------- 3 files changed, 24 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index a34f5e5439b..b1fd981965c 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1010,10 +1010,6 @@ class Repository raw_repository.fetch_source_branch!(source_repository.raw_repository, source_branch, local_ref) end - def remote_exists?(name) - raw_repository.remote_exists?(name) - end - def compare_source_branch(target_branch_name, source_repository, source_branch_name, straight:) raw_repository.compare_source_branch(target_branch_name, source_repository.raw_repository, source_branch_name, straight: straight) end diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 044c60caa05..4fc37b63085 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -940,11 +940,6 @@ module Gitlab false end - # Returns true if a remote exists. - def remote_exists?(name) - rugged.remotes[name].present? - end - # Update the specified remote using the values in the +options+ hash # # Example diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 03a9cc488ca..ad16f9af0f1 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -701,21 +701,6 @@ describe Gitlab::Git::Repository, seed_helper: true do end end - describe '#remote_exists?' do - before(:all) do - @repo = Gitlab::Git::Repository.new('default', TEST_MUTABLE_REPO_PATH, '') - @repo.add_remote("new_remote", SeedHelper::GITLAB_GIT_TEST_REPO_URL) - end - - it 'returns true for an existing remote' do - expect(@repo.remote_exists?('new_remote')).to eq(true) - end - - it 'returns false for a non-existing remote' do - expect(@repo.remote_exists?('foo')).to eq(false) - end - end - describe "#log" do let(:commit_with_old_name) do Gitlab::Git::Commit.decorate(repository, @commit_with_old_name_id) -- cgit v1.2.1