script/autobuild.py: add support git worktree
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Feb 2020 22:58:42 +0000 (23:58 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 2 Apr 2020 06:01:38 +0000 (06:01 +0000)
.git is not always a directory, with 'git worktree' it's a file.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
script/autobuild.py

index 3889d6ed6200c35f395fe6cda58aad8411797d22..f90c8bd9fd322f06ee26c8bf87d2183e7c7e9b47 100755 (executable)
@@ -37,7 +37,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