Skip to content

Feature request: support git worktrees #45

@lubieowoce

Description

@lubieowoce

Currently, if I try to use this extension in a worktree, it will error with

.git/HEAD does not exist

This is the same error as #23 , but it's happening for a different reason, so I thought it makes sense to open a separate issue.

The problem is that, in a git worktree, .git is a text file like this:

gitdir: <path to base repo>

so any code that assumes that .git is a directory will break.

Reproduction steps

mkdir worktree-test
cd worktree-test
# create 'worktree-test/one'
git clone git@github.com:lubieowoce/copy-github-url-test-repo.git one
cd one
# create 'worktree-test/two'
git worktree add -b test-branch ../two

in one, "copy github url" will work as expected. in two, it will show an error instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions