From 995ead5584411f71e6136331eabe59f8e1595cda Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 25 Oct 2022 15:52:44 -0600 Subject: [PATCH] chore: use local scoped variables --- get-changed-paths.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index e67dbaef9c5..e2655a49691 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -25,9 +25,10 @@ if [[ -n $INPUT_DIFF_RELATIVE ]]; then fi function get_diff() { - base="$1" - sha="$2" - filter="$3" + local base="$1" + local sha="$2" + local filter="$3" + while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base$DIFF$sha" -- "$sub" | grep '^[-]Subproject commit' | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then @@ -69,8 +70,9 @@ function get_diff() { } function get_renames() { - base="$1" - sha="$2" + local base="$1" + local sha="$2" + while IFS='' read -r sub; do sub_commit_pre="$(git diff "$base$DIFF$sha" -- "$sub" | grep '^[-]Subproject commit' | awk '{print $3}')" && exit_status=$? || exit_status=$? if [[ $exit_status -ne 0 ]]; then