Browse Source

Fix update-assemblyinfo.ps1 for worktrees

pull/1801/head
Siegfried Pammer 6 years ago
parent
commit
2be6d279b3
  1. 10
      BuildTools/update-assemblyinfo.ps1

10
BuildTools/update-assemblyinfo.ps1

@ -38,22 +38,26 @@ function Find-Git() {
return $false; return $false;
} }
function No-Git() {
return -not (((Test-Dir ".git") -or (Test-File ".git")) -and (Find-Git));
}
function gitVersion() { function gitVersion() {
if (-not ((Test-Dir ".git") -and (Find-Git))) { if (No-Git) {
return 0; return 0;
} }
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev; return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;
} }
function gitCommitHash() { function gitCommitHash() {
if (-not ((Test-Dir ".git") -and (Find-Git))) { if (No-Git) {
return "0000000000000000000000000000000000000000"; return "0000000000000000000000000000000000000000";
} }
return (git rev-list "$baseCommit..HEAD") | Select -First 1; return (git rev-list "$baseCommit..HEAD") | Select -First 1;
} }
function gitBranch() { function gitBranch() {
if (-not ((Test-Dir ".git" -or Test-File ".git") -and (Find-Git))) { if (No-Git) {
return "no-branch"; return "no-branch";
} }

Loading…
Cancel
Save