Open MarkAtRamp51 opened 4 years ago
Actually I noticed that this isn't supported by libgit2 yet, but there is a pending pull request for it so it may come soon.
This is probably also related/duplicate of the underlying problem in #1374 @MarkAtRamp51 what was the PR number? I can't seem to find a current PR related to long path support
@japj It's this one https://github.com/libgit2/libgit2/pull/5347
Reproduction steps
On Windows 10 (or any windows OS that supports long file paths, with Enable Win32 Long Paths enabled) Create a file path more than 260 characters long
Create a .net application using a version of .net framework of 4.6.2 or newer, and add an application manifest to enables support for long file paths. Call the Commands.Stage on this repo, adding all files.
An invalid path exception will be thrown indicating the path is too long.
Running "git add ." from the command line works as long as the core.longpaths=true config option is set in git, but the .net application still fails with this exception.
The system gitconfig looks as follows:
Expected behavior
Commands.Stage should add all the files to the index, as long as the file paths are less than 4096 characters.
Actual behavior
An InvalidPath exception is thrown:
Version of LibGit2Sharp (release number or SHA1)
0.26.2.97
Operating system(s) tested; .NET runtime tested
Windows Server 2019 Datacenter Edition, .NET Framework 4.7.2