From 429725f61abd7c28eae3d25ea4bd93a6c891cbd7 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 12 Aug 2010 17:07:36 +0200 Subject: [Funcs] get repo branch as git branch for Android.. --- 01_Functions.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to '01_Functions.zsh') 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) -- cgit v1.2.3