Microsoft.Build.Tasks.Git: Allow overriding git repositoryformatversion check
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
We just hit an issue over in https://github.com/pythonnet/pythonnet/issues/1613 where a git repository is checked out as part of a build step, but due to interactions between build systems, the `repositoryformatversion` is set to `1`, which then hits the following code in
https://github.com/dotnet/sourcelink/blob/48e002e14a97800c0d6acf24a55357699c9d72a4/src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs#L120-L125
Which then causes the Python wheel build to fail:
```
C:\Users\WDAGUtilityAccount\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported. [C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-req-build-4vyeo0ym\src\runtime\Python.Runtime.csproj]
C:\Users\WDAGUtilityAccount\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-req-build-4vyeo0ym\src\runtime'. [C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-req-build-4vyeo0ym\src\runtime\Python.Runtime.csproj]
Build FAILED.
C:\Users\WDAGUtilityAccount\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-req-build-4vyeo0ym\src\runtime'. [C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-req-build-4vyeo0ym\src\runtime\Python.Runtime.csproj]
C:\Users\WDAGUtilityAccount\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported. [C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-req-build-4vyeo0ym\src\runtime\Python.Runtime.csproj]
1 Warning(s)
1 Error(s)
```
Would it be possible to allow overriding this check via a property or environment variable?
I'm not sure what the impact of removing this check completely would be.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.