Skip to content

Commit ad2f860

Browse files
Explicitly set PSNativeCommandArgumentPassing to Legacy for git push script (Azure#34188)
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 <Wes.Haggard@microsoft.com>
1 parent 064b197 commit ad2f860

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

eng/common/scripts/git-branch-push.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ param(
3737
[boolean] $AmendCommit = $false
3838
)
3939

40+
# 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.
41+
# more info https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3#psnativecommandargumentpassing
42+
$PSNativeCommandArgumentPassing = "Legacy"
43+
4044
# This is necessary because of the git command output writing to stderr.
4145
# Without explicitly setting the ErrorActionPreference to continue the script
4246
# would fail the first time git wrote command output.

0 commit comments

Comments
 (0)