Skip to content

Commit 2f2a785

Browse files
committed
Addded Undo-GitRebase function #WIP
1 parent af0c1d3 commit 2f2a785

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Modules/IntelliTect.Git/IntelliTect.Git.psm1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,26 @@ Function Invoke-GitCommand {
4040

4141
PROCESS {
4242

43-
4443
if($ActionMessage) {
4544
$ActionMessage = " $($ActionMessage.Trim())";
4645
}
47-
48-
46+
4947
if($GitProperty) {
5048
# Format the output as JSON with keys&values single quoted (double quotes don't work with git format by default)
5149
# Later on the single quotes are converted back to double quotes.
5250
# TODO: What if there are single quotes in one of the values?
5351
$Format = "`"$( (Get-GitItemProperty -Name $GitProperty |
5452
ForEach-Object { "%($_)"}) -join ',')`""
5553
}
56-
54+
5755
$commandText = $Command | Where-Object { -not [string]::IsNullOrEmpty($_) } | Foreach-Object {
5856
# Remove git from the beginning of the command if it exists
5957
$eachCommandText = $_ -replace '^\s*(git)*\s',''
6058

6159
if($Format) {
6260
$eachCommandText += " --format=$Format"
6361
}
64-
62+
6563
if($PSBoundParameters['Verbose'] -and ($eachCommandText -notmatch '.*\s(-v|--verbose)(?:\s.*?|$).*')) {
6664
$eachCommandText += ' --verbose'
6765
}
@@ -71,7 +69,7 @@ Function Invoke-GitCommand {
7169
}
7270

7371
Write-Debug "Command: '$eachCommandText'"
74-
72+
7573
Write-Output $eachCommandText
7674
}
7775

@@ -106,6 +104,7 @@ Function Invoke-GitCommand {
106104
}
107105

108106

107+
109108
Function Get-GitRepo {
110109
[CmdletBinding()]
111110
param()

0 commit comments

Comments
 (0)