Forráskód Böngészése

Quick fix for git submodules

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Nick Ward 13 éve
szülő
commit
2d559a861f
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      dulwich/repo.py

+ 6 - 0
dulwich/repo.py

@@ -1250,6 +1250,12 @@ class Repo(BaseRepo):
               os.path.isdir(os.path.join(root, REFSDIR))):
             self.bare = True
             self._controldir = root
+        elif (os.path.isfile(os.path.join(root, ".git"))):
+            import re
+            with open(os.path.join(root, ".git"), 'r') as f:
+                _, path = re.match('(gitdir: )(.+$)', f.read()).groups()
+            self.bare = False
+            self._controldir = os.path.join(root, path)
         else:
             raise NotGitRepository(
                 "No git repository was found at %(path)s" % dict(path=root)