Browse Source

Fix #2572: Shallow clones do not produce correct version numbers as these require full history.

pull/2626/head
Siegfried Pammer 3 years ago
parent
commit
07bedd45d1
  1. 12
      BuildTools/update-assemblyinfo.ps1

12
BuildTools/update-assemblyinfo.ps1

@ -46,14 +46,22 @@ function gitVersion() { @@ -46,14 +46,22 @@ function gitVersion() {
if (No-Git) {
return 0;
}
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;
try {
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;
} catch {
return 0;
}
}
function gitCommitHash() {
if (No-Git) {
return "0000000000000000000000000000000000000000";
}
return (git rev-list --max-count 1 HEAD);
try {
return (git rev-list --max-count 1 HEAD);
} catch {
return "0000000000000000000000000000000000000000";
}
}
function gitBranch() {

Loading…
Cancel
Save