소스 검색

Hopeful for Windows compat

bmcorser 10 년 전
부모
커밋
111832309a
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      dulwich/repo.py

+ 3 - 2
dulwich/repo.py

@@ -687,12 +687,13 @@ class Repo(BaseRepo):
 
         :param start: The directory to start discovery from (defaults to '.')
         """
+        remaining = True
         path = os.path.abspath(start)
-        while path != '/':
+        while remaining:
             try:
                 return cls(path)
             except NotGitRepository:
-                path, _ = os.path.split(path)
+                path, remaining = os.path.split(path)
         raise NotGitRepository(
             "No git repository was found at %(path)s" % dict(path=start)
         )