This is an automated email from the ASF dual-hosted git repository.

aw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new 8a2afc82 YETUS-1222. smart-apply-patch EXTRA_ARGS should be an array 
(#303)
8a2afc82 is described below

commit 8a2afc824344a3bbf90eb8e1c68cafd1ba4cc47a
Author: Allen Wittenauer <a...@apache.org>
AuthorDate: Mon May 22 12:25:51 2023 -0700

    YETUS-1222. smart-apply-patch EXTRA_ARGS should be an array (#303)
---
 precommit/src/main/shell/smart-apply-patch.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/precommit/src/main/shell/smart-apply-patch.sh 
b/precommit/src/main/shell/smart-apply-patch.sh
index 2853b316..bf8758d9 100755
--- a/precommit/src/main/shell/smart-apply-patch.sh
+++ b/precommit/src/main/shell/smart-apply-patch.sh
@@ -29,7 +29,7 @@ BINDIR=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd 
-P)
 QATESTMODE=false
 STARTINGDIR=$(pwd)
 
-
+# shellcheck disable=SC2317
 ## @description  disable function
 ## @stability    stable
 ## @audience     private
@@ -39,6 +39,7 @@ function add_vote_table_v2
   true
 }
 
+# shellcheck disable=SC2317
 ## @description  disable function
 ## @stability    stable
 ## @audience     private
@@ -48,6 +49,7 @@ function add_footer_table
   true
 }
 
+# shellcheck disable=SC2317
 ## @description  disable function
 ## @stability    stable
 ## @audience     private
@@ -57,6 +59,7 @@ function big_console_header
   true
 }
 
+# shellcheck disable=SC2317
 ## @description  disable function
 ## @stability    stable
 ## @audience     private
@@ -66,7 +69,7 @@ function add_test
   true
 }
 
-
+# shellcheck disable=SC2317
 ## @description  disable function
 ## @stability    stable
 ## @audience     private
@@ -303,6 +306,7 @@ function gitam_dryrun
   fi
 }
 
+# shellcheck disable=SC2317
 ## @description  git am signoff
 ## @replaceable  no
 ## @audience     private
@@ -313,12 +317,12 @@ function gitam_apply
   declare gpg=$2
 
   if [[ ${gpg} = true ]]; then
-    EXTRA_ARGS="-S"
+    EXTRA_ARGS+=("-S")
   fi
 
   echo "Applying the patch:"
   yetus_run_and_redirect "${PATCH_DIR}/apply-patch-git-am.log" \
-    "${GIT}" am --signoff ${EXTRA_ARGS} --whitespace=fix "-p${PATCH_LEVEL}" 
"${patchfile}"
+    "${GIT}" am --signoff "${EXTRA_ARGS[@]}" --whitespace=fix 
"-p${PATCH_LEVEL}" "${patchfile}"
   RESULT=$?
   "${GREP}" -v "^Checking" "${PATCH_DIR}/apply-patch-git-am.log"
 
@@ -329,6 +333,7 @@ function gitam_apply
   fi
 }
 
+# shellcheck disable=SC2317
 ## @description  get author and summary from jira and commit it.
 ##               if the author and the summary contains " or *,
 ##               the function does not work correctly because
@@ -370,7 +375,7 @@ function gitapply_and_commit
   "${GIT}" add --all
   echo "Committing with author: ${author}, summary: ${summary}"
   yetus_run_and_redirect "${PATCH_DIR}/apply-patch-git-am-fallback.log" \
-    "${GIT}" commit ${EXTRA_ARGS} --signoff -m "${PATCH_OR_ISSUE}. ${summary}" 
\
+    "${GIT}" commit "${EXTRA_ARGS[@]}" --signoff -m "${PATCH_OR_ISSUE}. 
${summary}" \
     --author="${author}"
 }
 

Reply via email to