aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2021-06-21 14:43:35 -0600
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-06-22 15:16:12 -0400
commit06cc7c8820aea85d1329911b785d7bf4ecaacb1f (patch)
tree7012d736ef673ac160cdda858bc20ebf6228a7cf
parentaf8a12509de3e71b8c7dd6d6e0fd9f1752502b08 (diff)
downloadb4-stable-0.7.y.tar.gz
Allow '.git' to be a file for worktreesstable-0.7.y
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__.py2
1 files changed, 1 insertions, 1 deletions
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