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

Support for linked git worktrees broken in 1.2.7 #417

Closed
markrian opened this issue Jan 18, 2023 · 2 comments · Fixed by #418
Closed

Support for linked git worktrees broken in 1.2.7 #417

markrian opened this issue Jan 18, 2023 · 2 comments · Fixed by #418
Labels
bug Something isn't working

Comments

@markrian
Copy link

markrian commented Jan 18, 2023

🔧 Summary

Running lefthook install in a repository that is a linked worktree (not the main worktree) causes an error like:

$ lefthook install
Error: mkdir /home/markrian/my-linked-repo/home/markrian/my-main-repo/.git/info: no such file or directory

Lefthook version

1.2.7 c88a009

Steps to reproduce

  1. In a main worktree (any normal git repo) create a linked worktree e.g., git worktree add ~/path/to/new/repo
  2. Change directory to new repo (e.g., ~/path/to/new/repo)
  3. Run lefthook install
  4. Observe an error like:
$ lefthook install
Error: mkdir /home/markrian/path/to/new/repo/home/markrian/my-main-repo/.git/info: no such file or directory

If you try the same with lefthook 1.2.6, it succeeds without error.

If you run lefthook install from the main worktree, it also succeeds without error.

Expected results

lefthook install should work without error.

Actual results

There's an error.

Possible Solution

I suspect #414 is the source of this breakage, since it adds a mkdir call.

Screenshots (if appropriate)

n/a

@markrian markrian added the bug Something isn't working label Jan 18, 2023
@mrexox
Copy link
Member

mrexox commented Jan 19, 2023

Hey! Thank you for the issue. I will take a look and try to fix it today-tomorrow.

@mrexox
Copy link
Member

mrexox commented Jan 23, 2023

Than you a lot for a clean bug description! I will release the fix with version 1.2.8 soon

mrexox added a commit that referenced this issue Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants