Types/LibGit2Sharp.Repository.Types.ps1xml
<Types> <Type> <Name>LibGit2Sharp.Repository</Name> <Members> <ScriptProperty> <!-- The second-last part of the URL path --> <Name>Owner</Name> <GetScriptBlock> $this.Head.Owner ?? $this.Network.Remotes['origin'].Owner </GetScriptBlock> </ScriptProperty> <ScriptProperty> <!-- The last path part of the URL path, without the .git extension --> <Name>RepositoryName</Name> <GetScriptBlock> $this.Head.RepositoryName ?? $this.Network.Remotes['origin'].RepositoryName </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RefsByTarget</Name> <GetScriptBlock> # Lazy-compute and cache value # This is needed for performance to show refs in Get-GitCommit output if ($null -ne $this.PSObject.Properties['_refsByTarget']) { return $this._refsByTarget } $refsByTarget = $this.Refs | Group-Object -Property Target -AsHashTable Add-Member -InputObject $this -MemberType NoteProperty -Name _refsByTarget -Value $refsByTarget -Force return $refsByTarget </GetScriptBlock> </ScriptProperty> </Members> </Type> </Types> |