Skip to content

The agent that grows with you

fix(windows-e2e): parenthesize the tag-list split - -split bound as a git argument

ethernet71281c27e5af
diff --git a/tests/install/windows-desktop-gui-e2e.ps1 b/tests/install/windows-desktop-gui-e2e.ps1
index e5f950233a0..d1fd0bd0747 100644
--- a/tests/install/windows-desktop-gui-e2e.ps1
+++ b/tests/install/windows-desktop-gui-e2e.ps1
@@ -304,7 +304,10 @@ function Invoke-PhaseStage {
# user who installed on release day is on.
$oldRef = $InstallRef
if (-not $oldRef -or $oldRef -eq "auto") {
- $oldRef = (Invoke-Git @("-C", $RepoRoot, "tag", "--list", "v*", "--sort=-creatordate") -split "`r?`n" | Select-Object -First 1)
+ # Parens matter: without them PowerShell binds -split as an
+ # argument to Invoke-Git instead of an operator on its result.
+ $tagList = Invoke-Git @("-C", $RepoRoot, "tag", "--list", "v*", "--sort=-creatordate")
+ $oldRef = ($tagList -split "\r?\n" | Select-Object -First 1)
if (-not $oldRef) { throw "no v* release tags in the checkout and no -InstallRef given -- cannot pick an OLD version" }
}
$old = Invoke-Git @("-C", $RepoRoot, "rev-parse", "$oldRef^{commit}")