src/eric7/Plugins/VcsPlugins/vcsGit/git.py

branch
eric7
changeset 9636
926cb5408961
parent 9624
b47dfa7a137d
child 9653
e67609152c5e
diff -r d3be8955cb94 -r 926cb5408961 src/eric7/Plugins/VcsPlugins/vcsGit/git.py
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/git.py	Thu Dec 22 09:34:33 2022 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsGit/git.py	Thu Dec 22 09:35:17 2022 +0100
@@ -4330,7 +4330,7 @@
         return GitStatusMonitorThread(interval, project, self)
 
     ###########################################################################
-    ##  Method to find the repository root below
+    ##  Method to find the repository root
     ###########################################################################
 
     def findRepoRoot(self, start):
@@ -4343,8 +4343,12 @@
         @rtype str or None
         """
         repoRoot = start
-        while not os.path.exists(os.path.join(repoRoot, self.adminDirOrFile)):
+        while repoRoot and not os.path.exists(
+            os.path.join(repoRoot, self.adminDirOrFile)
+        ):
             repoRoot = os.path.dirname(repoRoot)
             if os.path.splitdrive(repoRoot)[1] == os.sep:
                 repoRoot = None
+                break
+
         return repoRoot

eric ide

mercurial