-
Notifications
You must be signed in to change notification settings - Fork 656
Description
When running gitversion within a worktree, the version that is calculated is against the HEAD of the main repository rather than the HEAD of the worktree itself. This is caused by the fact that the Repository object that is created is using the return from the main git directory rather than the worktree path.
I don't know how to fix this, because if I change it to either GetWorkingDirectory or GetProjectDirectory (either will work), the tests:
GitVersionCore.Tests.DynamicRepositoryTests.FindsVersionInDynamicRepo
DynamicRepositoriesShouldNotErrorWithFailedToFindGitDirectory
fail.
Obviously, the GetDotGitDirectory needs to return the actual directory so that caching works, however when in a worktree, the repository object that is created needs to be based on the worktree.
See also #1063