From bd0d07f56f1a32873d6d206834fb207d004aca0b Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 8 Jul 2022 17:23:03 +0200 Subject: [PATCH] Added git_branch() and git_customer_branch() --- git_helpers | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/git_helpers b/git_helpers index 99f2495..2a67093 100755 --- a/git_helpers +++ b/git_helpers @@ -57,6 +57,18 @@ revert_to_commit_before_pull () { } # revert_to_commit_before_pull +git_branch () { + # always relative to a git repository + echo $(git branch -a | grep '*' | awk '{ print $2 }') +} + +git_customer_branch () { + if cd_customer_repository; then + customer_branch=$(git_branch) + cd_home; + echo $customer_branch + fi +} # clone the customer repository in ./workspace. # this is done only once. #