Bug 1313446 - Detect a git repository when inside a git worktree. r=glandium
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 08 Dec 2016 08:28:36 -1000
changeset 325443 febbbdc0273edf0cf7da1cc9de046a9c58625292
parent 325442 539bdf40aacb30936dfcf25cb9d7c9f052c1f8df
child 325444 3ea1f28bd0f3b021b40693d6a3a6f944a9e82420
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersglandium
bugs1313446
milestone53.0a1
Bug 1313446 - Detect a git repository when inside a git worktree. r=glandium MozReview-Commit-ID: 8ngY6kNcp05
python/mozversioncontrol/mozversioncontrol/__init__.py
--- 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)