script/bisect-test.py: add support git worktree
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Aug 2021 11:26:41 +0000 (13:26 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Aug 2021 08:07:29 +0000 (08:07 +0000)
.git is not always a directory, with 'git worktree' it's a file.

Note we could also use 'git rev-parse --show-toplevel', but that's
a patch for another day.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
script/bisect-test.py

index b87df54ac09fa0e7a7eca34dbae1c5f51daaec46..7c5cd635f58f033c653196e11f6d2e9b3d811e90 100755 (executable)
@@ -48,7 +48,7 @@ def find_git_root():
     '''get to the top of the git repo'''
     p = os.getcwd()
     while p != '/':
-        if os.path.isdir(os.path.join(p, ".git")):
+        if os.path.exists(os.path.join(p, ".git")):
             return p
         p = os.path.abspath(os.path.join(p, '..'))
     return None