Skip to content

Commit

Permalink
assert repository not added to pool twice
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Jun 25, 2022
1 parent 1a6bbf5 commit 5bbd7b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/poetry/repositories/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def add_repository(
Adds a repository to the pool.
"""
repository_name = repository.name.lower()
if repository_name in self._lookup:
raise ValueError(f"{repository_name} already added")

if default:
if self.has_default():
Expand Down

0 comments on commit 5bbd7b4

Please sign in to comment.