Silence Windows git during quiet source updates
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
This commit is contained in:
+10
-2
@@ -416,13 +416,21 @@ function Install-FromSource {
|
|||||||
New-Item -ItemType Directory -Force -Path $parent | Out-Null
|
New-Item -ItemType Directory -Force -Path $parent | Out-Null
|
||||||
if (Test-Path (Join-Path $sourceCache ".git")) {
|
if (Test-Path (Join-Path $sourceCache ".git")) {
|
||||||
git -C $sourceCache remote set-url origin $Repo
|
git -C $sourceCache remote set-url origin $Repo
|
||||||
git -C $sourceCache fetch --depth 1 origin main
|
$fetchArgs = @("-C", $sourceCache, "fetch", "--depth", "1", "origin", "main")
|
||||||
|
if ($Quiet) {
|
||||||
|
$fetchArgs = @("-C", $sourceCache, "fetch", "-q", "--depth", "1", "origin", "main")
|
||||||
|
}
|
||||||
|
git @fetchArgs
|
||||||
git -C $sourceCache checkout -q -B main FETCH_HEAD
|
git -C $sourceCache checkout -q -B main FETCH_HEAD
|
||||||
} else {
|
} else {
|
||||||
if (Test-Path $sourceCache) {
|
if (Test-Path $sourceCache) {
|
||||||
Remove-Item -Recurse -Force $sourceCache
|
Remove-Item -Recurse -Force $sourceCache
|
||||||
}
|
}
|
||||||
git clone --depth 1 --branch main $Repo $sourceCache | Out-Null
|
$cloneArgs = @("clone", "--depth", "1", "--branch", "main", $Repo, $sourceCache)
|
||||||
|
if ($Quiet) {
|
||||||
|
$cloneArgs = @("clone", "-q", "--depth", "1", "--branch", "main", $Repo, $sourceCache)
|
||||||
|
}
|
||||||
|
git @cloneArgs | Out-Null
|
||||||
}
|
}
|
||||||
$src = $sourceCache
|
$src = $sourceCache
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,15 +167,34 @@ fn windows_installer_reuses_persistent_source_update_cache() {
|
|||||||
assert!(ps1.contains("Assert-NoRelativePathSegments $Path"));
|
assert!(ps1.contains("Assert-NoRelativePathSegments $Path"));
|
||||||
assert!(ps1.contains("$segment -eq \".\" -or $segment -eq \"..\""));
|
assert!(ps1.contains("$segment -eq \".\" -or $segment -eq \"..\""));
|
||||||
assert!(ps1.contains("$sourceCache = Assert-SafeUpdateCache $UpdateCache"));
|
assert!(ps1.contains("$sourceCache = Assert-SafeUpdateCache $UpdateCache"));
|
||||||
assert!(ps1.contains("git -C $sourceCache fetch --depth 1 origin main"));
|
assert!(ps1.contains(
|
||||||
|
"$fetchArgs = @(\"-C\", $sourceCache, \"fetch\", \"--depth\", \"1\", \"origin\", \"main\")"
|
||||||
|
));
|
||||||
|
assert!(ps1.contains("$fetchArgs = @(\"-C\", $sourceCache, \"fetch\", \"-q\", \"--depth\", \"1\", \"origin\", \"main\")"));
|
||||||
|
assert!(ps1.contains("git @fetchArgs"));
|
||||||
assert!(ps1.contains("git -C $sourceCache checkout -q -B main FETCH_HEAD"));
|
assert!(ps1.contains("git -C $sourceCache checkout -q -B main FETCH_HEAD"));
|
||||||
assert!(ps1.contains("git clone --depth 1 --branch main $Repo $sourceCache"));
|
assert!(ps1.contains(
|
||||||
|
"$cloneArgs = @(\"clone\", \"--depth\", \"1\", \"--branch\", \"main\", $Repo, $sourceCache)"
|
||||||
|
));
|
||||||
|
assert!(ps1.contains("$cloneArgs = @(\"clone\", \"-q\", \"--depth\", \"1\", \"--branch\", \"main\", $Repo, $sourceCache)"));
|
||||||
|
assert!(ps1.contains("git @cloneArgs | Out-Null"));
|
||||||
assert!(
|
assert!(
|
||||||
!ps1.contains("git clone --depth 1 $Repo $tmp"),
|
!ps1.contains("git clone --depth 1 $Repo $tmp"),
|
||||||
"Windows source updates should reuse a persistent cache instead of recloning into temp"
|
"Windows source updates should reuse a persistent cache instead of recloning into temp"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn windows_quiet_source_updates_silence_git_like_unix() {
|
||||||
|
let install = include_str!("../install.sh");
|
||||||
|
let ps1 = include_str!("../install.ps1");
|
||||||
|
assert!(install.contains("git -C \"$update_cache\" fetch -q --depth 1 origin main"));
|
||||||
|
assert!(install.contains("git clone -q --depth 1 --branch main \"$repo\" \"$update_cache\""));
|
||||||
|
assert!(ps1.contains("if ($Quiet)"));
|
||||||
|
assert!(ps1.contains("\"fetch\", \"-q\", \"--depth\""));
|
||||||
|
assert!(ps1.contains("\"clone\", \"-q\", \"--depth\""));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn windows_installer_bootstraps_rust_for_source_fallback_like_unix() {
|
fn windows_installer_bootstraps_rust_for_source_fallback_like_unix() {
|
||||||
let install = include_str!("../install.sh");
|
let install = include_str!("../install.sh");
|
||||||
|
|||||||
Reference in New Issue
Block a user