From 56e5e19a84133c07f4f909342b292eb2b3b6c0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 7 Oct 2012 03:25:55 +0200 Subject: [PATCH] Scripts: Fix branch detection with git older than 1.7.10 --- scripts/commit_all_submodules | 2 +- scripts/switch_all_submodules_to_head_and_clean | 2 +- scripts/update_all_submodules | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/commit_all_submodules b/scripts/commit_all_submodules index ce3a8c7ab..c754640e7 100755 --- a/scripts/commit_all_submodules +++ b/scripts/commit_all_submodules @@ -6,7 +6,7 @@ if [[ ! -e .git ]] || exit 1 fi -branch=`git symbolic-ref --short -q HEAD` +branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` if [[ -z "$branch" ]] || [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then echo "There is not active upstream branch. Exiting..." diff --git a/scripts/switch_all_submodules_to_head_and_clean b/scripts/switch_all_submodules_to_head_and_clean index c35d9f817..017153719 100755 --- a/scripts/switch_all_submodules_to_head_and_clean +++ b/scripts/switch_all_submodules_to_head_and_clean @@ -6,7 +6,7 @@ if [[ ! -e .git ]] || exit 1 fi -branch=`git symbolic-ref --short -q HEAD` +branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` if [[ -z "$branch" ]] || [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then echo "There is not active upstream branch. Exiting..." diff --git a/scripts/update_all_submodules b/scripts/update_all_submodules index 46fcc6d2e..8e6668f8a 100755 --- a/scripts/update_all_submodules +++ b/scripts/update_all_submodules @@ -12,7 +12,7 @@ if [[ ! -e .git ]] || exit 1 fi -branch=`git symbolic-ref --short -q HEAD` +branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` if [[ -z "$branch" ]] || [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then echo "There is not active upstream branch. Exiting..."