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 exit 1
fi fi
repository_name="$1" repository_name="$2"
branch_name=(basename "$2") branch_name=$(basename "$1")
BRANCHES_FOLDER="/html/branches" BRANCHES_FOLDER="/html/branches"
PROGRAMM_REPOSITORY="git_programm:AG-Programm/parteiprogramm.git" PROGRAMM_REPOSITORY="git_programm:AG-Programm/parteiprogramm.git"

View File

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