From b91ab9479cce110692cea423321f0e6f97a271cd Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Mon, 26 Feb 2018 15:52:24 +0100
Subject: [PATCH] Add git branch name to Prepare-Build.

---
 Scripts/Prepare-Build.ps1 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Scripts/Prepare-Build.ps1 b/Scripts/Prepare-Build.ps1
index 1276fdc..b5f28d9 100644
--- a/Scripts/Prepare-Build.ps1
+++ b/Scripts/Prepare-Build.ps1
@@ -14,6 +14,8 @@ try {
     if (-Not $?) { throw }
     $GitStatus = & git status --porcelain
     if (-Not $?) { throw }
+    $GitBranch = & git symbolic-ref --short HEAD
+    if (-Not $?) { throw }
 
     if ($GitStatus.Length -gt 0) {
         Write-Output "NOTE: repository has uncommitted changes!"
@@ -23,6 +25,7 @@ try {
 catch {
     $CommitName = "commit unknown"
     $GitStatus = "status unknown"
+    $GitBranch = "branch unknown"
     Write-Output "$(">"*8) Running git failed, using default values! $("<"*8)"
 }
 
@@ -38,5 +41,6 @@ Write-Output $Date > $BuildDate
 
 Write-Output $Date
 Write-Output $CommitName
+Write-Output $GitBranch
 
 cd $oldpwd
\ No newline at end of file
-- 
GitLab