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

Sourcelink unable to find .git directory in linked working tree #347

Closed
jkoritzinsky opened this issue Jul 17, 2019 · 2 comments · Fixed by #406
Closed

Sourcelink unable to find .git directory in linked working tree #347

jkoritzinsky opened this issue Jul 17, 2019 · 2 comments · Fixed by #406

Comments

@jkoritzinsky
Copy link
Member

When using git worktree add to create a second working tree, the SourceLink package is unable to locate the .git folder for the repository when in the linked working tree.

The .git folder is hard-linked to the location in the primary working tree's .git folder where the data is stored, which SourceLink (along with a wide variety of Windows programs it seems) doesn't understand how to traverse into.

@tmat
Copy link
Member

tmat commented Sep 8, 2019

SourceLink didn't trim the trailing whitespace of commondir file. #406 fixes that.
To work around delete the trailing \n in repo\.git\worktrees\{worktree}\commondir files for each worktree.

@tmat tmat closed this as completed in #406 Sep 8, 2019
@dagood
Copy link
Member

dagood commented Sep 9, 2019

Workaround doesn't work for me. Removing the trailing newline before Build.cmd in my repro steps at dotnet/arcade#3864 still shows errors:

...
C:\Users\dagood\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Unable to locate repository with working directory that contains directory 'D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.SignTool'. [D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.SignTool\Microsoft.DotNet.SignTool.csproj]
C:\Users\dagood\.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): error : Source control information is not available - the generated source link is empty. [D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.SignTool\Microsoft.DotNet.SignTool.csproj]
C:\Users\dagood\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Unable to locate repository with working directory that contains directory 'D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.Deployment.Tasks.Links'. [D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.Deployment.Tasks.Links\Microsoft.DotNet.Deployment.Tasks.Links.csproj]
C:\Users\dagood\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Unable to locate repository with working directory that contains directory 'D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.Arcade.Sdk'. [D:\temp\sourcelink-worktree\arcade-wt\src\Microsoft.DotNet.Arcade.Sdk\Microsoft.DotNet.Arcade.Sdk.csproj]
...

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 a pull request may close this issue.

3 participants