fixed release.sh to work on tags

(cherry picked from commit 938f4cb8c2e31c2bcc20fba7d973214ee38d650a)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/56101ee4
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/56101ee4
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/56101ee4

Branch: refs/heads/0.9.x
Commit: 56101ee431c5a2c2a5d15b01e86b88ce0be416c7
Parents: fc1d75a
Author: Rafael Schloming <[email protected]>
Authored: Tue Mar 31 05:05:51 2015 -0400
Committer: Robert Gemmell <[email protected]>
Committed: Fri Apr 24 15:42:01 2015 +0100

----------------------------------------------------------------------
 bin/release.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/56101ee4/bin/release.sh
----------------------------------------------------------------------
diff --git a/bin/release.sh b/bin/release.sh
index 68def92..984d7d5 100755
--- a/bin/release.sh
+++ b/bin/release.sh
@@ -51,9 +51,13 @@ die()
     if [ -n "$(git status -uno --porcelain)" ]; then
         die must release from a clean checkout
     fi
-    BRANCH=$(git symbolic-ref --short HEAD)
-    REMOTE=$(git config branch.${BRANCH}.remote)
-    git checkout --detach ${REMOTE}/${BRANCH}
+    BRANCH=$(git symbolic-ref -q --short HEAD)
+    if [ -n "${BRANCH}" ]; then
+        REMOTE=$(git config branch.${BRANCH}.remote)
+        git checkout --detach ${REMOTE}/${BRANCH}
+    else
+        REMOTE="origin"
+    fi
     bin/version.sh $VERSION
     git commit -a -m "Release $VERSION"
     git tag -m "Release $VERSION" $VERSION


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to