Skip to content

Commit 2658b2d

Browse files
authored
Merge pull request #1857 from microsoft/milestones/m262
Release M262
2 parents 45fc82a + 86f7b43 commit 2658b2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+529
-216
lines changed

.azure-pipelines/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
displayName: Install .NET SDK
2929
inputs:
3030
packageType: sdk
31-
version: 5.0.201
31+
version: 8.0.413
3232

3333
- task: CmdLine@2
3434
displayName: Build VFS for Git

.github/workflows/build.yaml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,38 @@ on:
55
branches: [ master, releases/shipped ]
66
push:
77
branches: [ master, releases/shipped ]
8+
workflow_dispatch:
9+
inputs:
10+
git_version:
11+
description: 'Microsoft Git version tag to include in the build (leave empty for default)'
12+
required: false
13+
type: string
14+
15+
env:
16+
GIT_VERSION: ${{ github.event.inputs.git_version || 'v2.50.1.vfs.0.1' }}
817

918
jobs:
19+
validate:
20+
runs-on: windows-2025
21+
name: Validation
22+
steps:
23+
- name: Checkout source
24+
uses: actions/checkout@v4
25+
26+
- name: Validate Microsoft Git version
27+
shell: pwsh
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: |
31+
& "$env:GITHUB_WORKSPACE\.github\workflows\scripts\validate_release.ps1" `
32+
-Repository microsoft/git `
33+
-Tag $env:GIT_VERSION && `
34+
Write-Host ::notice title=Validation::Using microsoft/git version $env:GIT_VERSION
35+
1036
build:
11-
runs-on: windows-2019
37+
runs-on: windows-2025
1238
name: Build and Unit Test
39+
needs: validate
1340

1441
strategy:
1542
matrix:
@@ -24,7 +51,7 @@ jobs:
2451
- name: Install .NET SDK
2552
uses: actions/setup-dotnet@v4
2653
with:
27-
dotnet-version: 5.0.201
54+
dotnet-version: 8.0.413
2855

2956
- name: Add MSBuild to PATH
3057
uses: microsoft/[email protected]
@@ -41,6 +68,13 @@ jobs:
4168
shell: cmd
4269
run: src\scripts\CreateBuildArtifacts.bat ${{ matrix.configuration }} artifacts
4370

71+
- name: Download microsoft/git installers
72+
shell: cmd
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: |
76+
gh release download %GIT_VERSION% --repo microsoft/git --pattern "Git*.exe" --dir artifacts\GVFS.Installers
77+
4478
- name: Upload functional tests drop
4579
uses: actions/upload-artifact@v4
4680
with:
@@ -59,20 +93,15 @@ jobs:
5993
name: Installers_${{ matrix.configuration }}
6094
path: artifacts\GVFS.Installers
6195

62-
- name: Upload NuGet packages
63-
uses: actions/upload-artifact@v4
64-
with:
65-
name: NuGetPackages_${{ matrix.configuration }}
66-
path: artifacts\NuGetPackages
67-
6896
functional_test:
69-
runs-on: windows-2019
97+
runs-on: ${{ matrix.architecture == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
7098
name: Functional Tests
7199
needs: build
72100

73101
strategy:
74102
matrix:
75103
configuration: [ Debug, Release ]
104+
architecture: [ x86_64, arm64 ]
76105

77106
steps:
78107
- name: Download installers
@@ -103,7 +132,7 @@ jobs:
103132
if: always()
104133
uses: actions/upload-artifact@v4
105134
with:
106-
name: InstallationLogs_${{ matrix.configuration }}
135+
name: InstallationLogs_${{ matrix.configuration }}_${{ matrix.architecture }}
107136
path: install\logs
108137

109138
- name: Run functional tests
@@ -117,14 +146,14 @@ jobs:
117146
if: always()
118147
uses: actions/upload-artifact@v4
119148
with:
120-
name: FunctionalTests_Results_${{ matrix.configuration }}
149+
name: FunctionalTests_Results_${{ matrix.configuration }}_${{ matrix.architecture }}
121150
path: TestResult.xml
122151

123152
- name: Upload Git trace2 output
124153
if: always()
125154
uses: actions/upload-artifact@v4
126155
with:
127-
name: GitTrace2_${{ matrix.configuration }}
156+
name: GitTrace2_${{ matrix.configuration }}_${{ matrix.architecture }}
128157
path: C:\temp\git-trace2.log
129158

130159
- name: ProjFS details (post-test)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string]$Tag,
4+
5+
[Parameter(Mandatory=$true)]
6+
[string]$Repository
7+
)
8+
9+
function Write-GitHubActionsCommand {
10+
param(
11+
[Parameter(Mandatory=$true)]
12+
[string]$Command,
13+
14+
[Parameter(Mandatory=$true)]
15+
[string]$Message,
16+
17+
[Parameter(Mandatory=$true)]
18+
[string]$Title
19+
)
20+
21+
Write-Host "::$Command title=$Title::$Message"
22+
}
23+
24+
25+
function Write-GitHubActionsWarning {
26+
param(
27+
[Parameter(Mandatory=$true)]
28+
[string]$Message,
29+
30+
[Parameter(Mandatory=$false)]
31+
[string]$Title = "Warning"
32+
)
33+
34+
if ($env:GITHUB_ACTIONS -eq "true") {
35+
Write-GitHubActionsCommand -Command "warning" -Message $Message -Title $Title
36+
} else {
37+
Write-Host "! Warning: $Message" -ForegroundColor Yellow
38+
}
39+
}
40+
41+
function Write-GitHubActionsError {
42+
param(
43+
[Parameter(Mandatory=$true)]
44+
[string]$Message,
45+
46+
[Parameter(Mandatory=$false)]
47+
[string]$Title = "Error"
48+
)
49+
50+
if ($env:GITHUB_ACTIONS -eq "true") {
51+
Write-GitHubActionsCommand -Command "error" -Message $Message -Title $Title
52+
} else {
53+
Write-Host "x Error: $Message" -ForegroundColor Red
54+
}
55+
}
56+
57+
if ([string]::IsNullOrWhiteSpace($Tag)) {
58+
Write-GitHubActionsError -Message "Tag parameter is required"
59+
exit 1
60+
}
61+
62+
if ([string]::IsNullOrWhiteSpace($Repository)) {
63+
Write-GitHubActionsError -Message "Repository parameter is required"
64+
exit 1
65+
}
66+
67+
Write-Host "Validating $Repository release '$Tag'..."
68+
69+
# Prepare headers for GitHub API
70+
$headers = @{
71+
'Accept' = 'application/vnd.github.v3+json'
72+
'User-Agent' = 'VFSForGit-Build'
73+
}
74+
75+
if ($env:GITHUB_TOKEN) {
76+
$headers['Authorization'] = "Bearer $env:GITHUB_TOKEN"
77+
}
78+
79+
# Check if the tag exists in microsoft/git repository
80+
try {
81+
$releaseResponse = Invoke-RestMethod `
82+
-Uri "https://api.github.com/repos/$Repository/releases/tags/$Tag" `
83+
-Headers $headers
84+
85+
Write-Host "✓ Tag '$Tag' found in $Repository" -ForegroundColor Green
86+
Write-Host " Release : $($releaseResponse.name)"
87+
Write-Host " Published : $($releaseResponse.published_at.ToString('u'))"
88+
89+
# Check if this a pre-release
90+
if ($releaseResponse.prerelease -eq $true) {
91+
Write-GitHubActionsWarning `
92+
-Message "Using a pre-released version of $Repository" `
93+
-Title "Pre-release $Repository version"
94+
}
95+
96+
# Get the latest release for comparison
97+
try {
98+
$latestResponse = Invoke-RestMethod `
99+
-Uri "https://api.github.com/repos/$Repository/releases/latest" `
100+
-Headers $headers
101+
$latestTag = $latestResponse.tag_name
102+
103+
# Check if this is the latest release
104+
if ($Tag -eq $latestTag) {
105+
Write-Host "✓ Using the latest release" -ForegroundColor Green
106+
exit 0
107+
}
108+
109+
# Not the latest!
110+
$warningTitle = "Outdated $Repository release"
111+
$warningMsg = "Not using latest release of $Repository (latest: $latestTag)"
112+
Write-GitHubActionsWarning -Message $warningMsg -Title $warningTitle
113+
} catch {
114+
Write-GitHubActionsWarning -Message "Could not check latest release info for ${Repository}: $($_.Exception.Message)"
115+
}
116+
} catch {
117+
if ($_.Exception.Response.StatusCode -eq 404) {
118+
Write-GitHubActionsError -Message "Tag '$Tag' does not exist in $Repository"
119+
exit 1
120+
} else {
121+
Write-GitHubActionsError -Message "Error validating release '$Tag': $($_.Exception.Message)"
122+
exit 1
123+
}
124+
}

.vsconfig

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"version": "1.0",
33
"components": [
44
"Microsoft.Component.MSBuild",
5-
"Microsoft.VisualStudio.Workload.NativeDesktop"
5+
"Microsoft.Net.Component.4.7.1.TargetingPack",
6+
"Microsoft.Net.Component.4.7.1.SDK",
7+
"Microsoft.Net.Core.Component.SDK.8.0",
8+
"Microsoft.VisualStudio.Component.VC.v143.x86.x64",
9+
"Microsoft.VisualStudio.Component.Windows11SDK.26100",
10+
"Microsoft.VisualStudio.Workload.NativeDesktop",
611
"Microsoft.VisualStudio.Workload.ManagedDesktop",
7-
"Microsoft.VisualStudio.Workload.NetCoreTools",
8-
"Microsoft.Net.Core.Component.SDK.2.1",
9-
"Microsoft.VisualStudio.Component.VC.v141.x86.x64",
10-
"Microsoft.Net.Component.4.6.1.TargetingPack",
11-
"Microsoft.Net.Component.4.6.1.SDK",
12+
"Microsoft.VisualStudio.Workload.NetCoreTools"
1213
]
1314
}

GVFS/FastFetch/FastFetch.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net461</TargetFramework>
5+
<TargetFramework>net471</TargetFramework>
66
<PlatformTarget>x64</PlatformTarget>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
</PropertyGroup>

GVFS/GVFS.Common/Enlistment.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,18 @@ public virtual GitProcess CreateGitProcess()
109109
{
110110
return new GitProcess(this);
111111
}
112+
113+
public bool GetTrustPackIndexesConfig()
114+
{
115+
var gitProcess = this.CreateGitProcess();
116+
bool trustPackIndexes = true;
117+
if (gitProcess.TryGetFromConfig(GVFSConstants.GitConfig.TrustPackIndexes, forceOutsideEnlistment: false, out var valueString)
118+
&& bool.TryParse(valueString, out var trustPackIndexesConfig))
119+
{
120+
trustPackIndexes = trustPackIndexesConfig;
121+
}
122+
123+
return trustPackIndexes;
124+
}
112125
}
113126
}

GVFS/GVFS.Common/GVFS.Common.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFramework>net471</TargetFramework>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
</PropertyGroup>
77

@@ -13,6 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16+
<Reference Include="System.Net.Http" />
1617
<Reference Include="System.Web" />
1718
</ItemGroup>
1819

GVFS/GVFS.Common/Git/GitObjects.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,7 @@ public virtual bool TryDownloadPrefetchPacks(GitProcess gitProcess, long latestT
135135
* pack file and an index file that do not match.
136136
* Eventually we will make this the default, but it has a high performance cost for the first prefetch after
137137
* cloning a large repository, so it must be explicitly enabled for now. */
138-
bool trustPackIndexes = true;
139-
if (gitProcess.TryGetFromConfig(GVFSConstants.GitConfig.TrustPackIndexes, forceOutsideEnlistment: false, out var valueString)
140-
&& bool.TryParse(valueString, out var trustPackIndexesConfig))
141-
{
142-
trustPackIndexes = trustPackIndexesConfig;
143-
}
138+
bool trustPackIndexes = this.Enlistment.GetTrustPackIndexesConfig();
144139
metadata.Add("trustPackIndexes", trustPackIndexes);
145140

146141
long requestId = HttpRequestor.GetNewRequestId();

GVFS/GVFS.Common/Git/GitRepo.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.IO.Compression;
66
using System.Linq;
7+
using static GVFS.Common.Git.LibGit2Repo;
78

89
namespace GVFS.Common.Git
910
{
@@ -60,9 +61,9 @@ public void OpenRepo()
6061
this.libgit2RepoInvoker?.InitializeSharedRepo();
6162
}
6263

63-
public bool TryGetIsBlob(string sha, out bool isBlob)
64+
public bool TryGetObjectType(string sha, out Native.ObjectTypes? objectType)
6465
{
65-
return this.libgit2RepoInvoker.TryInvoke(repo => repo.IsBlob(sha), out isBlob);
66+
return this.libgit2RepoInvoker.TryInvoke(repo => repo.GetObjectType(sha), out objectType);
6667
}
6768

6869
public virtual bool TryCopyBlobContentStream(string blobSha, Action<Stream, long> writeAction)
@@ -86,10 +87,12 @@ public virtual bool TryCopyBlobContentStream(string blobSha, Action<Stream, long
8687
return copyBlobResult;
8788
}
8889

89-
public virtual bool CommitAndRootTreeExists(string commitSha)
90+
public virtual bool CommitAndRootTreeExists(string commitSha, out string rootTreeSha)
9091
{
9192
bool output = false;
92-
this.libgit2RepoInvoker.TryInvoke(repo => repo.CommitAndRootTreeExists(commitSha), out output);
93+
string treeShaLocal = null;
94+
this.libgit2RepoInvoker.TryInvoke(repo => repo.CommitAndRootTreeExists(commitSha, out treeShaLocal), out output);
95+
rootTreeSha = treeShaLocal;
9396
return output;
9497
}
9598

0 commit comments

Comments
 (0)