diff --git a/src/GitTabExpansion.ps1 b/src/GitTabExpansion.ps1 index 5820da226..8d14a9ce8 100644 --- a/src/GitTabExpansion.ps1 +++ b/src/GitTabExpansion.ps1 @@ -310,6 +310,12 @@ function Expand-GitCommand($Command) { function GitTabExpansionInternal($lastBlock, $GitStatus = $null) { $ignoreGitParams = '(?\s+-(?:[aA-zZ0-9]+|-[aA-zZ0-9][aA-zZ0-9-]*)(?:=\S+)?)*' + # Remove direct git parameters like -p, -P + # @ToDo: doesn't work with parameters followed by a value like -C + if ($lastBlock -match "\s*(\S+\s)\s*((?:-\S+\s)*)([^-]\S+.*)") { + $lastBlock = $matches[1] + $matches[3] + } + if ($lastBlock -match "^$(Get-AliasPattern git) (?\S+)(? .*)$") { $lastBlock = expandGitAlias $Matches['cmd'] $Matches['args'] }