fixed order of programm hook parameters and repository fetching

main
Andre Challier 2024-03-28 09:25:40 +01:00
parent 9fdcc3455c
commit 74daa3224c
2 changed files with 10 additions and 9 deletions

View File

@ -6,8 +6,8 @@ if [ "$#" -ne 2 ]; then
exit 1
fi
repository_name="$1"
branch_name=(basename "$2")
repository_name="$2"
branch_name=$(basename "$1")
BRANCHES_FOLDER="/html/branches"
PROGRAMM_REPOSITORY="git_programm:AG-Programm/parteiprogramm.git"

View File

@ -29,13 +29,14 @@ done
#
# Fetch all branch names
#
git ls-remote --heads "$PROGRAMM_REPOSITORY" |
# Extract branch names
awk '{print $2}' |
# Remove "refs/heads/" prefix to get only branch names
sed 's#refs/heads/##' |
# Store branch names in an array
mapfile -t branches
branches=()
while read -r ref; do
# Extract branch name from the reference
branch_name=$(echo "$ref" | awk '{print $2}' | sed 's/refs\/heads\///')
# put into array
branches+=("$branch_name")
done < <(git ls-remote --heads "$PROGRAMM_REPOSITORY")
for branch in "${branches[@]}";
do