Bug 1313446 - Detect a git repository when inside a git worktree. r?glandium
MozReview-Commit-ID: 8H6K4GKfvUh
--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
@@ -94,12 +94,12 @@ class GitRepository(Repository):
self._run('add', path)
def get_repository_object(path):
'''Get a repository object for the repository at `path`.
If `path` is not a known VCS repository, raise an exception.
'''
if os.path.isdir(os.path.join(path, '.hg')):
return HgRepository(path)
- elif os.path.isdir(os.path.join(path, '.git')):
+ elif os.path.exists(os.path.join(path, '.git')):
return GitRepository(path)
else:
raise Exception('Unknown VCS, or not a source checkout: %s' % path)