summaryrefslogtreecommitdiff
path: root/01_Functions.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2010-08-12 17:07:36 +0200
committerHugues Hiegel <hugues@hiegel.fr>2010-08-12 17:07:36 +0200
commit429725f61abd7c28eae3d25ea4bd93a6c891cbd7 (patch)
treea724bd735f6758628989c4d612b83f9c29e6d793 /01_Functions.zsh
parent4499241f7e1f3752cb8de4c4312e8c373aa24a6f (diff)
[Funcs] get repo branch as git branch for Android..
Diffstat (limited to '01_Functions.zsh')
-rw-r--r--01_Functions.zsh10
1 files changed, 10 insertions, 0 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh
index 73d6775..a9ecb48 100644
--- a/01_Functions.zsh
+++ b/01_Functions.zsh
@@ -102,6 +102,16 @@ get_git_branch ()
return
fi
+ if [ -f ".repo/manifests.git/config" ]
+ then
+ my_git_branch=$(grep merge .repo/manifests.git/config | awk '{print $3}')
+ if [ $my_git_branch != "" ]
+ then
+ echo $my_git_branch
+ return
+ fi
+ fi
+
[ "$( ( git-ls-files ; git-ls-tree HEAD . ) 2>&- | head -n1)" = "" -a \( ! -d .git -o "$(git-rev-parse --git-dir 2>&-)" != ".git" \) -a "$(git-rev-parse --is-inside-git-dir 2>&-)" != "true" ] && return
GIT_DIR=$(git-rev-parse --git-dir)