ugit.types.ps1xml

<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 1.9.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Types>
  <Type>
    <Name>git.branch</Name>
    <Members>
      <ScriptMethod>
        <Name>Delete</Name>
        <Script>
                        Push-Location $this.GitRoot
git branch '-d' $this.BranchName @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>ToString</Name>
        <Script>
                        $this.BranchName

                    </Script>
      </ScriptMethod>
    </Members>
  </Type>
  <Type>
    <Name>git.branch.detail</Name>
    <Members>
      <ScriptMethod>
        <Name>Delete</Name>
        <Script>
                        Push-Location $this.GitRoot
git branch '-d' $this.BranchName @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>ToString</Name>
        <Script>
                        $this.BranchName

                    </Script>
      </ScriptMethod>
    </Members>
  </Type>
  <Type>
    <Name>git.commit.info</Name>
    <Members>
      <ScriptMethod>
        <Name>Amend</Name>
        <Script>
                        param(
[Parameter(Mandatory)]
[string]
$Message
)

Push-Location $this.GitRoot
git commit --ammend -m $Message @args
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>UpdateMessage</Name>
        <Script>
                        param(
[Parameter(Mandatory)]
[string]
$Message
)

Push-Location $this.GitRoot
git commit --ammend -m $Message @args
Pop-Location


                    </Script>
      </ScriptMethod>
    </Members>
  </Type>
  <Type>
    <Name>git.log</Name>
    <Members>
      <ScriptMethod>
        <Name>Archive</Name>
        <Script>
                        param(
[Parameter(Mandatory)]
[string]
$ArchivePath
)
$unresolvedArchivePath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($ArchivePath)

Push-Location $this.GitRoot
git archive $this.CommitHash '-o' "$unresolvedArchivePath" @args
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Checkout</Name>
        <Script>
                        Push-Location $this.GitRoot
git checkout $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Diff</Name>
        <Script>
                        Push-Location $this.GitRoot
git diff $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Reset</Name>
        <Script>
                        Push-Location $this.GitRoot
git reset $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Revert</Name>
        <Script>
                        Push-Location $this.GitRoot
git revert $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptProperty>
        <Name>ReferenceNumbers</Name>
        <GetScriptBlock>
                        [Regex]::new("#(?&lt;n&gt;\d+)").Matches($this.CommitMessage) -replace '#' -as [int[]]
                    </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <Type>
    <Name>git.reference.log</Name>
    <Members>
      <AliasProperty>
        <Name>CommitHash</Name>
        <ReferencedMemberName>Hash</ReferencedMemberName>
      </AliasProperty>
      <ScriptMethod>
        <Name>Archive</Name>
        <Script>
                        param(
[Parameter(Mandatory)]
[string]
$ArchivePath
)
$unresolvedArchivePath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($ArchivePath)

Push-Location $this.GitRoot
git archive $this.CommitHash '-o' "$unresolvedArchivePath" @args
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Checkout</Name>
        <Script>
                        Push-Location $this.GitRoot
git checkout $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Diff</Name>
        <Script>
                        Push-Location $this.GitRoot
git diff $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Reset</Name>
        <Script>
                        Push-Location $this.GitRoot
git reset $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Revert</Name>
        <Script>
                        Push-Location $this.GitRoot
git revert $this.CommitHash @args
Pop-Location
                    </Script>
      </ScriptMethod>
      <ScriptProperty>
        <Name>ReferenceNumbers</Name>
        <GetScriptBlock>
                        [Regex]::new("#(?&lt;n&gt;\d+)").Matches($this.CommitMessage) -replace '#' -as [int[]]
                    </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <Type>
    <Name>git.stash.entry</Name>
    <Members>
      <ScriptMethod>
        <Name>Apply</Name>
        <Script>
                        Push-Location $this.GitRoot
git stash apply $this.Number
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Delete</Name>
        <Script>
                        Push-Location $this.GitRoot
git stash drop $this.Number
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Diff</Name>
        <Script>
                        Push-Location $this.GitRoot
git stash show $this.Number --patch
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Drop</Name>
        <Script>
                        Push-Location $this.GitRoot
git stash drop $this.Number
Pop-Location

                    </Script>
      </ScriptMethod>
      <ScriptMethod>
        <Name>Pop</Name>
        <Script>
                        Push-Location $this.GitRoot
git stash pop $this.Number
Pop-Location


                    </Script>
      </ScriptMethod>
    </Members>
  </Type>
  <Type>
    <Name>git.status</Name>
    <Members>
      <ScriptMethod>
        <Name>Push</Name>
        <Script>
                        Push-Location $this.GitRoot
if (-not $this.Status) {
    git push --set-upstream origin $this.BranchName @args
} else {
    git push @args
}
Pop-Location

                    </Script>
      </ScriptMethod>
    </Members>
  </Type>
</Types>