alirezanet / Husky.Net

Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
https://alirezanet.github.io/Husky.Net/
MIT License
632 stars 29 forks source link

Attach husky do not work with GIT Worktree #43

Closed arnaudcrasborn closed 2 years ago

arnaudcrasborn commented 2 years ago

Version

v0.4.2

Details

Husky is attached to my dotnet project as follow

  <Target Name="husky" BeforeTargets="Restore;CollectPackageReferences" Condition="$(MuteHusky) == '' or $(MuteHusky) == false">
    <Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
    <Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory="$(BuildRoot)" />
  </Target>

It works fine except if I use GIT Worktree. In this case, I receive the following error: > dotnet husky install .git can't be found (see https://alirezanet.github.io/Husky.Net/guide/getting-started) Git hooks installation failed It seems that Husky cannot work with the link ".git" (found in the linked working tree) that references the ".git" directory.

Steps to reproduce

alirezanet commented 2 years ago

Hi @arnaudcrasborn

Please try v0.4.4 and let me know if it has solved your problem. Thank you for the feedback.

arnaudcrasborn commented 2 years ago

Hi @alirezanet, thank you for the quick fix/exhancement. It is working now as expected with the version 0.4.4.