From c0dd194bdd9318107d187878a7a3b21c6eaf9b3b Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 21 Jun 2021 14:43:35 -0600 Subject: Allow '.git' to be a file for worktrees With multiple git worktrees, '.git' can be a file pointing to the real '.git' directory, so the current check for a directory is too strict. Signed-off-by: Rob Herring Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20210621204335.1627303-1-robh@kernel.org --- b4/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b4/__init__.py b/b4/__init__.py index 9a18d00..b45e26f 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1848,7 +1848,7 @@ def git_run_command(gitdir: Optional[str], args: List[str], stdin: Optional[byte logstderr: bool = False) -> Tuple[int, str]: cmdargs = ['git', '--no-pager'] if gitdir: - if os.path.isdir(os.path.join(gitdir, '.git')): + if os.path.exists(os.path.join(gitdir, '.git')): gitdir = os.path.join(gitdir, '.git') cmdargs += ['--git-dir', gitdir] cmdargs += args -- cgit v1.2.3