Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git: remove exact version match #322

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<!-- Version information -->
<ScalarVersion>0.2.173.2</ScalarVersion>
<GitPackageVersion>2.20200116.1</GitPackageVersion>
<MinimumGitVersion>v2.25.0.vfs.1.1</MinimumGitVersion>
<WatchmanPackageUrl>https://github.com/facebook/watchman/suites/307436006/artifacts/304557</WatchmanPackageUrl>
<GcmCoreOSXPackageUrl>https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.79-beta/gcmcore-osx-2.0.79.64449.pkg</GcmCoreOSXPackageUrl>

Expand Down
10 changes: 0 additions & 10 deletions Scalar.Common/Scalar.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
</ItemGroup>

<Target Name="_GenerateConstantsFile" BeforeTargets="BeforeBuild">
<!--
Extract the minimum Git version using the Git for Windows package.
We assume the Git for Mac package contains the same Git version for
the same NuGet package version.
-->
<GetGitInstallerVersion PackagePath="$(PkgGitForWindows_GVFS_Installer)"
InstallerExtension=".exe">
<Output TaskParameter="GitVersion" PropertyName="MinimumGitVersion" />
</GetGitInstallerVersion>

<!-- Generate Scalar constants file with the minimum Git version -->
<GenerateScalarConstants MinimumGitVersion="$(MinimumGitVersion)"
ExternalBinariesDirectoryName="$(ExternalBinariesDirectoryName)"
Expand Down
59 changes: 0 additions & 59 deletions Scalar.MSBuild/GetGitInstallerVersion.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Scalar.MSBuild/Scalar.tasks
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<Code Type="Class" Source="$(MSBuildThisFileDirectory)GenerateWindowsAppManifest.cs" />
</Task>
</UsingTask>
<UsingTask TaskName="GetGitInstallerVersion" TaskFactory="$(_TaskFactory)" AssemblyFile="$(_TaskAssembly)">
<Task>
<Code Type="Class" Source="$(MSBuildThisFileDirectory)GetGitInstallerVersion.cs" />
</Task>
</UsingTask>
<UsingTask TaskName="GenerateScalarConstants" TaskFactory="$(_TaskFactory)" AssemblyFile="$(_TaskAssembly)">
<Task>
<Code Type="Class" Source="$(MSBuildThisFileDirectory)GenerateScalarConstants.cs" />
Expand Down
30 changes: 6 additions & 24 deletions Scalar/CommandLine/ScalarVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,31 +499,13 @@ private void CheckGitVersion(ITracer tracer, ScalarEnlistment enlistment, out st
this.ReportErrorAndExit(tracer, "Error: Invalid version of git {0}. Must use scalar version.", version);
}

if (ProcessHelper.IsDevelopmentVersion())
if (gitVersion.IsLessThan(ScalarConstants.SupportedGitVersion))
{
if (gitVersion.IsLessThan(ScalarConstants.SupportedGitVersion))
{
this.ReportErrorAndExit(
tracer,
"Error: Installed git version {0} is less than the supported version of {1}.",
gitVersion,
ScalarConstants.SupportedGitVersion);
}
else if (!gitVersion.IsEqualTo(ScalarConstants.SupportedGitVersion))
{
this.Output.WriteLine($"Warning: Installed git version {gitVersion} does not match supported version of {ScalarConstants.SupportedGitVersion}.");
}
}
else
{
if (!gitVersion.IsEqualTo(ScalarConstants.SupportedGitVersion))
{
this.ReportErrorAndExit(
tracer,
"Error: Installed git version {0} does not match supported version of {1}.",
gitVersion,
ScalarConstants.SupportedGitVersion);
}
this.ReportErrorAndExit(
tracer,
"Error: Installed git version {0} is less than the supported version of {1}.",
gitVersion,
ScalarConstants.SupportedGitVersion);
}
}

Expand Down