ci: prepare.sh should accept --history without argument

The --history does not take an argument, similar to --help. Move it out
of ARGUMENT_LIST so 'getopt' does not complain about it.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-08-18 14:18:33 +02:00
parent 64588e2b1c
commit 46d0ae5495

View File

@ -14,11 +14,10 @@ ARGUMENT_LIST=(
"workdir"
"gitrepo"
"base"
"history"
)
opts=$(getopt \
--longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")help" \
--longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")history,help" \
--name "$(basename "${0}")" \
--options "" \
-- "$@"
@ -67,7 +66,6 @@ while true; do
base=${1}
;;
--history)
shift
history="yes"
;;
--)
@ -89,7 +87,7 @@ then
depth=''
fi
git clone "${depth}" --branch="${base}" "${gitrepo}" "${workdir}"
git clone ${depth} --branch="${base}" "${gitrepo}" "${workdir}"
cd "${workdir}"
git fetch origin "${ref}:tip/${ref}"
git checkout "tip/${ref}"