Browse Source

Improve tools/build-auto-update.sh when working on detached HEAD

AT-sleep-until-message
catbref 4 years ago
parent
commit
9c18a33d7f
  1. 4
      tools/build-auto-update.sh

4
tools/build-auto-update.sh

@ -13,7 +13,7 @@ fi
cd ${git_dir}
# Check we are in 'master' branch
branch_name=$( git symbolic-ref -q HEAD )
branch_name=$( git symbolic-ref -q HEAD || echo )
branch_name=${branch_name##refs/heads/}
echo "Current git branch: ${branch_name}"
if [ "${branch_name}" != "master" ]; then
@ -78,5 +78,7 @@ git add ${project}.update
git commit --message "XORed, auto-update JAR based on commit ${short_hash}"
git push --set-upstream origin --force-with-lease ${update_branch}
branch_name=${branch_name-master}
echo "Changing back to '${branch_name}' branch"
git checkout --force ${branch_name}

Loading…
Cancel
Save