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

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