Skip to content

Commit

Permalink
YETUS-1222. smart-apply-patch EXTRA_ARGS should be an array (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
aw-was-here committed May 22, 2023
1 parent b83d268 commit 8a2afc8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions precommit/src/main/shell/smart-apply-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,6 +39,7 @@ function add_vote_table_v2
true
}

# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -48,6 +49,7 @@ function add_footer_table
true
}

# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -57,6 +59,7 @@ function big_console_header
true
}

# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand All @@ -66,7 +69,7 @@ function add_test
true
}


# shellcheck disable=SC2317
## @description disable function
## @stability stable
## @audience private
Expand Down Expand Up @@ -303,6 +306,7 @@ function gitam_dryrun
fi
}

# shellcheck disable=SC2317
## @description git am signoff
## @replaceable no
## @audience private
Expand All @@ -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"

Expand All @@ -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
Expand Down Expand Up @@ -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}"
}

Expand Down

0 comments on commit 8a2afc8

Please sign in to comment.