Merge pull request #432 from carlossg/daily

[INFRA-729] Correctly determine what branch are we in, again
diff --git a/publish.sh b/publish.sh
index d59d450..94e77ab 100755
--- a/publish.sh
+++ b/publish.sh
@@ -26,7 +26,7 @@
 
 get-variant() {
     local branch
-    branch=$(git show-ref --heads | grep $(git rev-list -n 1 HEAD) | sed -e 's#.*/heads/##')
+    branch=$(git show-ref | grep $(git rev-list -n 1 HEAD) | tail -1 | rev | cut -d/ -f 1 | rev)
     if [ -z "$branch" ]; then
         >&2 echo "Could not get the current branch name for commit, not in a branch?: $(git rev-list -n 1 HEAD)"
         return 1