Skip to content

Commit 2d7bc7f

Browse files
committed
shellcheck - do not assign array to string, SC2124
Convert rest to array as it hold command-line arguments.
1 parent eaabe53 commit 2d7bc7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

check/pytest-changed-files

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
3333
cd "${topdir}" || exit $?
3434

3535
# Figure out which branch to compare against.
36-
rest=$@
36+
rest=( "$@" )
3737
if [ -n "$1" ] && [[ $1 != -* ]]; then
3838
if [ "$(git cat-file -t "$1" 2> /dev/null)" != "commit" ]; then
3939
echo -e "\033[31mNo revision '$1'.\033[0m" >&2
4040
exit 1
4141
fi
4242
rev=$1
43-
rest=${@:2}
43+
rest=( "${@:2}" )
4444
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
4545
rev=upstream/master
4646
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
@@ -78,4 +78,4 @@ fi
7878

7979
source dev_tools/pypath
8080

81-
pytest ${rest} "${changed[@]}"
81+
pytest "${rest[@]}" "${changed[@]}"

0 commit comments

Comments
 (0)