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

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