You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using (var config = Configuration.BuildFrom(null))
{
var longpaths = config.GetValueOrDefault<bool>("core.longpaths", ConfigurationLevel.Global);
// can use also "git config --system core.longpaths true", but requires elevation.
if (!longpaths)
longpaths = config.GetValueOrDefault<bool>("core.longpaths", ConfigurationLevel.System);
_useCoreLongPaths = !longpaths;
}
Also need to test that windows supports long paths:
[SupportedOSPlatform("windows")]
static bool Reconfigure()
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\FileSystem"))
{
object o = key.GetValue("LongPathsEnabled");
if (!(o is int) || (int)o == 0)
{
Console.WriteLine("\n\nError: Please enable 'LongPathsEnabled' registry entry accoding to:\n" +
"https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry\n");
return false;
}
}
return true;
}
...somewhere in Main...
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Reconfigure())
{
return -3;
}
I have an immediate specific need for long path support on windows. Found
Support
core.longpaths
on Windows #5347but it does not appear to have been merged yet.....
It there a build (even if unofficial) that I could use for test purposes???
The text was updated successfully, but these errors were encountered: