From 1b09d15937f5be3d96e9b0e01f61b001db86fe31 Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 6 Aug 2026 15:31:17 +1000 Subject: [PATCH] feat(git-provider): More placeholder overrides for future use --- src/PowershellModule/Git/GitProvider.cs | 18 +++++++++++++++++- src/PowershellModule/Git/GitPsDriveInfo.cs | 12 ++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/PowershellModule/Git/GitPsDriveInfo.cs diff --git a/src/PowershellModule/Git/GitProvider.cs b/src/PowershellModule/Git/GitProvider.cs index 5167ede..5b290be 100644 --- a/src/PowershellModule/Git/GitProvider.cs +++ b/src/PowershellModule/Git/GitProvider.cs @@ -16,16 +16,20 @@ public class GitProvider : NavigationCmdletProvider protected override PSDriveInfo NewDrive(PSDriveInfo drive) { + // This is a bit of a hack to ensure that no drive is registered with a root location. + // It seems to be how PSDrives are registered for Alias providers, and we technically don't have any concept + // of a normal file system if (drive.Root != string.Empty) { throw new Exception("Drive root must be an empty string"); } + return base.NewDrive(drive); } protected override void NewItem(string path, string itemTypeName, object newItemValue) { - base.NewItem(path, itemTypeName, newItemValue); + //base.NewItem(path, itemTypeName, newItemValue); } protected override PSDriveInfo RemoveDrive(PSDriveInfo drive) @@ -33,6 +37,18 @@ public class GitProvider : NavigationCmdletProvider return base.RemoveDrive(drive); } + protected override void GetChildNames(string path, ReturnContainers returnContainers) + { + // TODO: get all configured repos based on a path from the underlying GitPsDriveInfo then + // output their repository names + } + + protected override void GetChildItems(string path, bool recurse) + { + // TODO: get all configured repos based on a path from the underlying GitPsDriveInfo then + // output their repository locations and any other meta data I store + } + // I think this is needed to be able to cd into it protected override bool IsItemContainer(string path) { diff --git a/src/PowershellModule/Git/GitPsDriveInfo.cs b/src/PowershellModule/Git/GitPsDriveInfo.cs new file mode 100644 index 0000000..2566267 --- /dev/null +++ b/src/PowershellModule/Git/GitPsDriveInfo.cs @@ -0,0 +1,12 @@ +using System.Management.Automation; + +namespace PowershellModule.Git; + +public class GitPsDriveInfo : PSDriveInfo +{ + protected GitPsDriveInfo(PSDriveInfo driveInfo) + : base(driveInfo) + { + + } +} \ No newline at end of file