Allow '.git' to be a file for worktrees
PATCH 1/1 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 <[email protected]>
---
Turns out I had 2 issues and didn't notice you fixed the first one when I rebased. With the first one fixed, it's the same issue with worktrees I recently fixed in the kernel.
b4/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
b4/__init__.py +1 -1
@@ -1834,7 +1834,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
Signature · 1 line
2.27.0
Konstantin Ryabitsev
AppliedQuoted 2 lines · Rob Herring
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.
Applied, thanks!
[1/1] Allow '.git' to be a file for worktrees
commit: c0dd194bdd9318107d187878a7a3b21c6eaf9b3b
Best regards,
Signature · 1 line
Konstantin Ryabitsev <[email protected]>