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

Add handling for Git worktrees #22

Merged
merged 2 commits into from
Jan 24, 2021
Merged

Conversation

ecraig12345
Copy link
Contributor

As described in #21, the extension doesn't currently work with Git worktrees. This change updates the logic in RepositoryFinder to allow .git to be either a directory or a file (it's a file for worktrees). Provided that the directory containing .git is only ever used as the cwd for running git commands, not for digging around in the git folder structure, this should be safe.

I added one test, but please let me know if there are other specific things you'd like to see tested and where to add that.

Fixes #21.

@reduckted
Copy link
Owner

Awesome! Thank you so much for the contribution, it works well.

I've just made one change to the test - the repository needed to have a commit before a worktree could be created.

@reduckted reduckted merged commit d8524ad into reduckted:master Jan 24, 2021
@ecraig12345 ecraig12345 deleted the worktrees branch January 24, 2021 06:25
@ecraig12345
Copy link
Contributor Author

Thanks for fixing the test! I saw the failure but was having trouble running the tests locally (and didn’t have time to dig in).

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

Successfully merging this pull request may close these issues.

Doesn't work with Git worktrees
2 participants