chore(git-provider): explore setting the location based on a child fragment match

This commit is contained in:
Scott 2026-08-07 16:49:30 +10:00
commit 1363f6ce02
2 changed files with 19 additions and 1 deletions

View file

@ -61,6 +61,24 @@ public class GitProvider : NavigationCmdletProvider
return true;
}
protected override string MakePath(string parent, string child)
{
// Test to see what happens if set the location if the path matches a pretend repo registered with the name test
// The result of the test is that yes, this does work, but there's also a shit load of calls to this method as
// it traverses the entire directory path.
// This seems to just be internal powershell behaviour so as long as this is quick the first time, everything
// afterwards just always happens. But probably happens more seeing as I'm changing the location of the path
// in this current SessionState and probably doesn't happen if this were a normal path traversal
// where I don't set the location.
if (child == "test")
{
SessionState.Path.SetLocation("F:/Repos/PowershellModule/src/PowershellModule/Git");
return "F:/Repos/PowershellModule/src/PowershellModule/Git";
}
return base.MakePath(parent, child);
}
protected override bool IsValidPath(string path)
{
throw new System.NotImplementedException();