Use basename to get only the name of the repo

This commit is contained in:
Gerhard Hoffmann 2023-05-25 14:41:04 +02:00
parent 346247b88a
commit a9cb3b53f4

View File

@ -4,7 +4,7 @@ echo "CURR-HEAD=$2"
echo "BRANCH-CHECKOUT=$3" echo "BRANCH-CHECKOUT=$3"
if [ -f /opt/app/tools/atbupdate/checkout_history ]; then if [ -f /opt/app/tools/atbupdate/checkout_history ]; then
readonly repo=$(git rev-parse --show-toplevel) readonly repo=i$(basename $(git rev-parse --show-toplevel))
readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)(\(.*\))/\2/g') readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)(\(.*\))/\2/g')
echo "$repo:$branch" echo "$repo:$branch"
fi fi