Skip to content

Commit

Permalink
Explicitly set PSNativeCommandArgumentPassing to Legacy for git push …
Browse files Browse the repository at this point in the history
…script (#4481)

https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3#psnativecommandargumentpassing
Do to that breaking change in PS 7.3 we need to opt into the legacy arg parsing.

Co-authored-by: Wes Haggard <[email protected]>
  • Loading branch information
2 people authored and antkmsft committed Apr 5, 2023
1 parent d40a587 commit a2bf1d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eng/common/scripts/git-branch-push.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ param(
[boolean] $AmendCommit = $false
)

# Explicit set arg parsing to Legacy mode because some of the git calls in this script depend on empty strings being empty and not passing a "" git.
# more info https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3#psnativecommandargumentpassing
$PSNativeCommandArgumentPassing = "Legacy"

# This is necessary because of the git command output writing to stderr.
# Without explicitly setting the ErrorActionPreference to continue the script
# would fail the first time git wrote command output.
Expand Down

0 comments on commit a2bf1d6

Please sign in to comment.