From 346247b88af56d3546c9a305769f62f2fea2ff2e Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 25 May 2023 14:33:48 +0200 Subject: [PATCH] extract branch info --- .githooks/post-checkout | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index f404caa..8655751 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -3,4 +3,8 @@ echo "PREV-HEAD=$1" echo "CURR-HEAD=$2" echo "BRANCH-CHECKOUT=$3" -git log --graph --all --decorate $2 | head -n 1 +if [ -f /opt/app/tools/atbupdate/checkout_history ]; then + readonly repo=$(git rev-parse --show-toplevel) + readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)(\(.*\))/\2/g') + echo "$repo:$branch" +fi