Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 11, 2025

Summary

Fixes an error when using Git repositories with the relativeWorktrees extension, which is enabled when creating worktrees with relative paths.

Problem

Git supports using relative paths for worktree locations via the relativeWorktrees extension:

git worktree add --relative-paths ..\Test123 -d

However, SourceLink was throwing an error when encountering repositories with this extension:

Error reading git repository information: Unsupported repository extension 'relativeworktrees'. 
Only noop, preciousObjects, partialclone, worktreeConfig are supported.

Solution

Added "relativeWorktrees" to the list of known git extensions in GitRepository.cs. This follows the same pattern as other supported extensions (noop, preciousObjects, partialclone, worktreeConfig).

Changes

  • GitRepository.cs: Added "relativeWorktrees" to the s_knownExtensions array
  • GitRepositoryTests.cs: Added test OpenRepository_Version1_RelativeWorktreesExtension() to verify repositories with this extension can be opened successfully

References

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • st8vsblobprodcus339.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/sourcelink/sourcelink/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/sourcelink/sourcelink/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/sourcelink/sourcelink/artifacts/toolset/10.0.0-beta.25479.115.txt (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Error when using relative worktree paths</issue_title>
<issue_description>Git supports using relative paths for worktree locations
e.g.
git worktree add --relative-paths ..\Test123 -d

But sourcelink fails when this feature is used.

Error reading git repository information: Unsupported repository extension 'relativeworktrees'. Only noop, preciousObjects, partialclone, worktreeConfig are supported.

Please add support for the relativeWorktrees extension.
https://git-scm.com/docs/git-config#Documentation/git-config.txt-relativeWorktrees</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #1468


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Add support for relative worktrees extension Add support for relativeWorktrees git extension Oct 11, 2025
@Copilot Copilot AI requested a review from tmat October 11, 2025 17:18
Copilot finished work on behalf of tmat October 11, 2025 17:18
@tmat tmat changed the base branch from main to release/10.0.2xx October 15, 2025 18:01
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.

Error when using relative worktree paths

2 participants