Explorar o código

Don't use just the fact that the objects directory exists.

Jelmer Vernooij %!s(int64=16) %!d(string=hai) anos
pai
achega
80f3bb3545
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      dulwich/repo.py

+ 2 - 1
dulwich/repo.py

@@ -214,7 +214,8 @@ class Repo(object):
         if os.path.isdir(os.path.join(root, ".git", OBJECTDIR)):
             self.bare = False
             self._controldir = os.path.join(root, ".git")
-        elif os.path.isdir(os.path.join(root, OBJECTDIR)):
+        elif (os.path.isdir(os.path.join(root, OBJECTDIR)) and
+              os.path.isdir(os.path.join(root, REFSDIR))):
             self.bare = True
             self._controldir = root
         else: