Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git worktrees are not discovered as projects #134

Closed
joelhock opened this issue Jul 28, 2017 · 3 comments
Closed

git worktrees are not discovered as projects #134

joelhock opened this issue Jul 28, 2017 · 3 comments
Milestone

Comments

@joelhock
Copy link

a git worktree ( https://git-scm.com/docs/git-worktree ) has a .git directory entry that is not a folder with a config file, but rather just a plain file that points to the repo directory, e.g:

cat .git
gitdir: ../dev/.git/worktrees/worktree-dev

which is not detected by

    public isRepoDir(projectPath: string) {
        return fs.existsSync(path.join(projectPath, ".git", "config"));
    }

i'd say checking for the existence of a .git file or directory is enough to know you're in a directory that should be added as a project, but I might be missing something.

@alefragnani
Copy link
Owner

Hi @joelhock ,

I didn't know about git worktree (still moving from other VCS) and used a snippet to check for git repos. I will update the detection to support this as well.

Thanks for reporting 👍

@hellorayza
Copy link

Is it supported display worktree now?😀
I use git worktree usually by this way :
git worktree add --track -b dev ../project_dev
and folder tree like this:

├── project
│   ├── .git (foder)
├── project_dev
│   ├── .git (file)

@alefragnani
Copy link
Owner

Hi @hellorayza ,

It should be working. At least, since I closed the issue and released the update (more than 2 years ago), no one has complained about it 😬 .

Isn’t working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants