Linux maintainer tooling and workflows
 help / color / 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

* Re: [PATCH] Allow '.git' to be a file for worktrees
  2021-06-21 20:43 [PATCH] Allow '.git' to be a file for worktrees Rob Herring
@ 2021-06-22 19:15 ` Konstantin Ryabitsev
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2021-06-22 19:15 UTC (permalink / raw)
  To: Rob Herring; +Cc: tools

On Mon, 21 Jun 2021 14:43:35 -0600, Rob Herring wrote:
> 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,
-- 
Konstantin Ryabitsev <konstantin@linuxfoundation.org>

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

end of thread, back to index

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

Linux maintainer tooling and workflows

Archives are clonable:
	git clone --mirror https://lore.kernel.org/tools/0 tools/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 tools tools/ https://lore.kernel.org/tools \
		tools@linux.kernel.org
	public-inbox-index tools

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.linux.tools


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git