From 94d5392cedf92d7e6a01ecbc6bdf1d57bde9957c Mon Sep 17 00:00:00 2001 From: Rejman Nascimento Date: Fri, 1 Mar 2024 13:49:52 -0300 Subject: [PATCH] fix: no closure function & noglob --- plugins/git-commit/git-commit.plugin.zsh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 380ec58a0..aabee7273 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -29,12 +29,6 @@ build_message() { local argc=${#@} local i=1 - remove_flags() { - local regex="${(j:|:)_git_commit_flags}" - - echo -n $(sed -E "s/\s*($regex)\s*//g" <<< "$1") - } - while [[ $i -lt $argc ]]; do local flag="${argv[$i]}" local value="${argv[$i + 1]}" @@ -59,7 +53,7 @@ build_message() { done local template="'$type'${scope}$attention: ${@}" - local message=$(remove_flags "$template" "${_git_commit_flags[@]}") + local message=$(noglob sed -E "s/\s*(${(j:|:)_git_commit_flags})\s*//g" <<< "$template") git commit -m "$message" }