diff options
author | Rob Herring <robh@kernel.org> | 2021-06-21 14:43:35 -0600 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-06-22 14:01:09 -0400 |
commit | c0dd194bdd9318107d187878a7a3b21c6eaf9b3b (patch) | |
tree | 99399a1705741674d9a4f45bbe8f5d2bc5e5a0d2 | |
parent | a5a225c4471aa94dabbf93d9c3172fb8aa58a8f0 (diff) | |
download | b4-c0dd194bdd9318107d187878a7a3b21c6eaf9b3b.tar.gz |
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 <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210621204335.1627303-1-robh@kernel.org
-rw-r--r-- | b4/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |