summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-03-05 15:43:06 +0100
committerSlávek Banko <slavek.banko@axis.cz>2016-03-05 15:43:06 +0100
commit2c769321341c07e85339cf60778cdb7d102f20b1 (patch)
tree563ada2e44e18361b30f5a2dd2556b567014bb8b
parent980d8ea3f8929655d0f135cde0f788b30ed558dc (diff)
downloadscripts-2c769321341c07e85339cf60778cdb7d102f20b1.tar.gz
scripts-2c769321341c07e85339cf60778cdb7d102f20b1.zip
Allow to create tarballs on detached branch
For example, for a particular git tag Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rwxr-xr-xcreate_all_tarballs2
-rwxr-xr-xcreate_tarball2
2 files changed, 2 insertions, 2 deletions
diff --git a/create_all_tarballs b/create_all_tarballs
index d35f67f..2745ed3 100755
--- a/create_all_tarballs
+++ b/create_all_tarballs
@@ -39,7 +39,7 @@ if [[ ! -e .git ]] ||
fi
# Check remote branch
-branch=`git branch --contains HEAD | grep -v "no branch" | head -n1 | cut -c 3-`
+branch=`git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
if [[ -z "$branch" ]] ||
[[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
echo "There is not active upstream branch. Exiting..."
diff --git a/create_tarball b/create_tarball
index e8f7004..68a4a9c 100755
--- a/create_tarball
+++ b/create_tarball
@@ -27,7 +27,7 @@ if [[ ! -e .git ]] ||
fi
# Check remote branch
-branch=`git branch --contains HEAD | grep -v "no branch" | head -n1 | cut -c 3-`
+branch=`git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
if [[ -z "$branch" ]] ||
[[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
echo "There is not active upstream branch. Exiting..."