tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: tools@linux.kernel.org
Subject: [PATCH] Allow '.git' to be a file for worktrees
Date: Mon, 21 Jun 2021 14:43:35 -0600	[thread overview]
Message-ID: <20210621204335.1627303-1-robh@kernel.org> (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 <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


             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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20210621204335.1627303-1-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    --subject='Re: [PATCH] Allow '\''.git'\'' to be a file for worktrees' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).