archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <>
To: Konstantin Ryabitsev <>
Subject: [PATCH] Allow '.git' to be a file for worktrees
Date: Mon, 21 Jun 2021 14:43:35 -0600	[thread overview]
Message-ID: <> (raw)

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 <>
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/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

             reply	other threads:[~2021-06-21 20:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 20:43 Rob Herring [this message]
2021-06-22 19:15 ` Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: [PATCH] Allow '\''.git'\'' to be a file for worktrees' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).