File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -40,28 +40,26 @@ Function Invoke-GitCommand {
40
40
41
41
PROCESS {
42
42
43
-
44
43
if ($ActionMessage ) {
45
44
$ActionMessage = " $ ( $ActionMessage.Trim ()) " ;
46
45
}
47
-
48
-
46
+
49
47
if ($GitProperty ) {
50
48
# Format the output as JSON with keys&values single quoted (double quotes don't work with git format by default)
51
49
# Later on the single quotes are converted back to double quotes.
52
50
# TODO: What if there are single quotes in one of the values?
53
51
$Format = " `" $ ( (Get-GitItemProperty - Name $GitProperty |
54
52
ForEach-Object { " %($_ )" }) -join ' ,' ) `" "
55
53
}
56
-
54
+
57
55
$commandText = $Command | Where-Object { -not [string ]::IsNullOrEmpty($_ ) } | Foreach-Object {
58
56
# Remove git from the beginning of the command if it exists
59
57
$eachCommandText = $_ -replace ' ^\s*(git)*\s' , ' '
60
58
61
59
if ($Format ) {
62
60
$eachCommandText += " --format=$Format "
63
61
}
64
-
62
+
65
63
if ($PSBoundParameters [' Verbose' ] -and ($eachCommandText -notmatch ' .*\s(-v|--verbose)(?:\s.*?|$).*' )) {
66
64
$eachCommandText += ' --verbose'
67
65
}
@@ -71,7 +69,7 @@ Function Invoke-GitCommand {
71
69
}
72
70
73
71
Write-Debug " Command: '$eachCommandText '"
74
-
72
+
75
73
Write-Output $eachCommandText
76
74
}
77
75
@@ -106,6 +104,7 @@ Function Invoke-GitCommand {
106
104
}
107
105
108
106
107
+
109
108
Function Get-GitRepo {
110
109
[CmdletBinding ()]
111
110
param ()
You can’t perform that action at this time.
0 commit comments