From f62440950be90c862a96027db94ef0e60a303013 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Tue, 17 Jul 2018 13:05:26 -0700 Subject: [PATCH] Use is_repository_directory() inside VersionControl.controls_location(). --- src/pip/_internal/vcs/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pip/_internal/vcs/__init__.py b/src/pip/_internal/vcs/__init__.py index 4a392b891..66a3c93cb 100644 --- a/src/pip/_internal/vcs/__init__.py +++ b/src/pip/_internal/vcs/__init__.py @@ -204,6 +204,8 @@ class VersionControl(object): """ Return whether a directory path is a repository directory. """ + logger.debug('Checking in %s for %s (%s)...', + path, self.dirname, self.name) return os.path.exists(os.path.join(path, self.dirname)) # See issue #1083 for why this method was introduced: @@ -472,10 +474,8 @@ class VersionControl(object): It is meant to be overridden to implement smarter detection mechanisms for specific vcs. """ - logger.debug('Checking in %s for %s (%s)...', - location, cls.dirname, cls.name) - path = os.path.join(location, cls.dirname) - return os.path.exists(path) + vcs = cls() + return vcs.is_repository_directory(location) def get_src_requirement(dist, location):