summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/repository.rb4
-rw-r--r--lib/gitlab/git/repository.rb5
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb15
3 files changed, 0 insertions, 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)