Skip to content

Commit

Permalink
Git wrapper from mroth#14 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Keranen committed Jul 11, 2024
1 parent 54fb23b commit 4993310
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions commands/inits/data/git_wrapper.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Remove-Item alias:\git
Remove-Item function:\git

$SCMPUFF_GIT_CMD = Get-Command git | Select-Object -ExpandProperty Definition

function git {
switch -regex -casesensitive($args[0]) {
"^(commit|blame|log|rebase|merge)$" {
& scmpuff expand -- $SCMPUFF_GIT_CMD $args
}
"^(checkout|diff|rm|reset)$" {
& scmpuff expand --relative -- $SCMPUFF_GIT_CMD $args
}
"^add$" {
& scmpuff expand -- $SCMPUFF_GIT_CMD $args
scmpuff status
}
default {
& $SCMPUFF_GIT_CMD $args
}
}
}

0 comments on commit 4993310

Please sign in to comment.