tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow '.git' to be a file for worktrees
@ 2021-06-21 20:43 Rob Herring
  2021-06-22 19:15 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2021-06-21 20:43 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

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>
---
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(-)

diff --git a/b4/__init__.py b/b4/__init__.py
index 53eaf2757e2a..2bb789e2eaf9 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -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
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-22 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 20:43 [PATCH] Allow '.git' to be a file for worktrees Rob Herring
2021-06-22 19:15 ` Konstantin Ryabitsev

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox