Skip to content

Commit

Permalink
Reverting VersionControl.controls_location() to pre PR state. Its a…
Browse files Browse the repository at this point in the history
…n optimization that belongs in another PR.
  • Loading branch information
tbeswick-enphase committed Oct 11, 2019
1 parent f197479 commit 24a2be8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/pip/_internal/vcs/versioncontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,17 +656,10 @@ def controls_location(cls, location):
# type: (str) -> bool
"""
Check if a location is controlled by the vcs.
It is meant to be overridden to implement smarter detection
mechanisms for specific vcs.
Searches up the filesystem and checks is_repository_directory().
It is meant to be extended to add smarter detection mechanisms for
specific vcs. For example, the Git override checks that Git is
actually available.
This can do more than is_repository_directory() alone. For example,
the Git override checks that Git is actually available.
"""
while not cls.is_repository_directory(location):
last_location = location
location = os.path.dirname(location)
if location == last_location:
# We've traversed up to the root of the filesystem.
return False
return True
return cls.is_repository_directory(location)

0 comments on commit 24a2be8

Please sign in to comment.