fixed order of programm hook parameters and repository fetching
parent
9fdcc3455c
commit
74daa3224c
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue