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>
In case the history of the branch is needed (commitlint job), add an
option --history to skip cloning the repository with --depth=1.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
When checking out a PR for a non-master branch, `git clone` should
download the last commit of the branch. Adding a `--base=..` option to
pass the cloning of a selected branch, instead of `master`.
We also want to fetch all commits in the PR, so they can get tested with
`commitlint`. Only fetch --depth=1 the initial clone, but fetch
everything in the PR itself.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
In ./prepare.sh line 21:
if [ $? -ne 0 ]
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./prepare.sh line 28:
eval set -- ${opts}
^-----^ SC2086: Double quote to prevent globbing and word splitting.
In ./prepare.sh line 55:
echo ${ref}
^----^ SC2086: Double quote to prevent globbing and word splitting.
In ./prepare.sh line 69:
git clone --depth=1 ${gitrepo} ${workdir}
^--------^ SC2086: Double quote to prevent globbing and word splitting.
^--------^ SC2086: Double quote to prevent globbing and word splitting.
In ./prepare.sh line 70:
cd ${workdir}
^-----------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
^--------^ SC2086: Double quote to prevent globbing and word splitting.
Signed-off-by: Niels de Vos <ndevos@redhat.com>