Blame SOURCES/core-setup-4510-commit-id.patch

133fb8
From e02ee86364b9db3edc298a6a081004aa07473d09 Mon Sep 17 00:00:00 2001
133fb8
From: Omair Majid <omajid@redhat.com>
133fb8
Date: Wed, 29 Aug 2018 17:03:25 -0400
133fb8
Subject: [PATCH] Allow setting the commit id using /p:LatestCommit
133fb8
133fb8
This is similar to how CommitCount is already supported.
133fb8
133fb8
This lets consumers who are building outside a git repo, such as
133fb8
source-build, set a commit id which is displayed by `dotnet --info`
133fb8
and `strings dotnet | grep '@(#)'`.
133fb8
133fb8
See: https://github.com/dotnet/source-build/issues/651
133fb8
See: https://github.com/dotnet/cli/pull/5945
133fb8
---
133fb8
 dir.targets | 9 +++++----
133fb8
 1 file changed, 5 insertions(+), 4 deletions(-)
133fb8
133fb8
diff --git a/dir.targets b/dir.targets
133fb8
index 8d34872c6..59dc1ebde 100644
133fb8
--- a/dir.targets
133fb8
+++ b/dir.targets
133fb8
@@ -17,7 +17,8 @@
133fb8
     <Exec Command="$(DotnetToolCommand) build $(MSBuildThisFileDirectory)tools-local/tasks/core-setup.tasks.csproj" />
133fb8
   </Target>
133fb8
 
133fb8
-  <Target Name="GetLatestCommitHash">
133fb8
+  
133fb8
+          Condition="'$(LatestCommit)' == ''">
133fb8
     
133fb8
     <Exec Command="git rev-parse HEAD 2>&1" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
133fb8
       <Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
133fb8
@@ -29,13 +30,13 @@
133fb8
     </PropertyGroup>
133fb8
   </Target>
133fb8
 
133fb8
-  <Target Name="GetCommitCount">
133fb8
+  
133fb8
+          Condition="'$(CommitCount)' == ''">
133fb8
     
133fb8
           StandardOutputImportance="Low"
133fb8
           IgnoreExitCode="true"
133fb8
           IgnoreStandardErrorWarningFormat="true"
133fb8
-          ConsoleToMSBuild="true"
133fb8
-          Condition="'$(CommitCount)' == ''">
133fb8
+          ConsoleToMSBuild="true">
133fb8
      <Output TaskParameter="ConsoleOutput" PropertyName="CommitCount" />
133fb8
      <Output TaskParameter="ExitCode" PropertyName="CommitCountExitCode" />
133fb8
     </Exec>