From 06cc7c8820aea85d1329911b785d7bf4ecaacb1f 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 48f43a2..0e007be 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1727,7 +1727,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