Skip to content

Commit 05781cc

Browse files
authored
[Windows] Add GVFS (Git Virtual File System) (actions#3766)
* Add GVFS (Git Virtual File System) * invoke all tests from git file
1 parent 9400af6 commit 05781cc

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

images/win/scripts/Installers/Install-Git.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@ Choco-Install -PackageName git -ArgumentList '--installargs="/VERYSILENT /NOREST
99
# Install hub
1010
Choco-Install -PackageName hub
1111

12+
# Install GVFS
13+
$url = "https://api.github.com/repos/microsoft/VFSForGit/releases/latest"
14+
[System.String] $gvfsLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "SetupGVFS.+\.exe$"
15+
$gvfsInstallerPath = Start-DownloadWithRetry -Url $gvfsLatest -Name "SetupGVFS.exe"
16+
17+
# Start-Process waits on the entire process tree but Wait-Process only waits on the initiating process(GVFS.Service.UI.exe)
18+
$env:GVFS_UNATTENDED = "1"
19+
$argList = "/VERYSILENT", "/NORESTART", "/NOCANCEL", "/SP-", "/CLOSEAPPLICATIONS", "/RESTARTAPPLICATIONS", "/SUPPRESSMSGBOXES"
20+
Start-Process $gvfsInstallerPath -ArgumentList $argList -PassThru | Wait-Process
21+
1222
# Disable GCM machine-wide
1323
[Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine)
1424

25+
# Add to PATH
1526
Add-MachinePathItem "C:\Program Files\Git\bin"
1627

1728
if (Test-IsWin16) {
@@ -22,5 +33,5 @@ if (Test-IsWin16) {
2233
ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
2334
ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
2435

25-
Invoke-PesterTests -TestFile "Git" -TestName "Git"
36+
Invoke-PesterTests -TestFile "Git"
2637
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Hub CLI"

images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ $markdown += New-MDList -Style Unordered -Lines (@(
8686
(Get-GHCVersion),
8787
(Get-GitVersion),
8888
(Get-GitLFSVersion),
89+
(Get-GVFSVersion),
8990
(Get-GoogleCloudSDKVersion),
9091
(Get-InnoSetupVersion),
9192
(Get-JQVersion),

images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ function Get-GitLFSVersion {
6767
return "Git LFS $gitLfsVersion"
6868
}
6969

70+
function Get-GVFSVersion {
71+
$gvfsVersion = (Get-Command gvfs).Version
72+
return "GVFS $gvfsVersion"
73+
}
74+
7075
function Get-InnoSetupVersion {
7176
return $(choco list --local-only innosetup) | Select-String -Pattern "InnoSetup"
7277
}

images/win/scripts/Tests/Git.Tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ Describe "Git" {
2323
$env:GCM_INTERACTIVE | Should -BeExactly Never
2424
}
2525
}
26+
27+
Describe "GVFS" {
28+
It "GVFS is installed" {
29+
"gvfs --version" | Should -ReturnZeroExitCode
30+
}
31+
}

0 commit comments

Comments
 (0)