diff options
author | Haltarys <45515869+Haltarys@users.noreply.github.com> | 2023-09-10 09:28:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-10 09:28:33 +0200 |
commit | b07c8cfe692bc6c7702f0aef5d493b12dfb43392 (patch) | |
tree | 24c0540d7d74dda69c1638fa5406a33dd71cf5ce /plugins/git-commit/git-commit.plugin.zsh | |
parent | 079dbff2c4f22935a71101c511e2285327d8ab68 (diff) | |
download | zsh-b07c8cfe692bc6c7702f0aef5d493b12dfb43392.tar.gz zsh-b07c8cfe692bc6c7702f0aef5d493b12dfb43392.tar.bz2 zsh-b07c8cfe692bc6c7702f0aef5d493b12dfb43392.zip |
fix(git-commit): fix compatibility of alias functions (#11883)
Diffstat (limited to 'plugins/git-commit/git-commit.plugin.zsh')
-rw-r--r-- | plugins/git-commit/git-commit.plugin.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 2ac8aa5f4..4ad4c0177 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -1,6 +1,6 @@ function _git_commit_register { if ! git config --global --get-all alias.$1 >/dev/null 2>&1; then - git config --global alias.$1 '!a() { if [[ "$1" == "-s" || "$1" == "--scope" ]]; then git commit -m "'$1'(${2}): ${@:3}"; else git commit -m "'$1': ${@}"; fi }; a' + git config --global alias.$1 '!a() { if [ "$1" = "-s" ] || [ "$1" = "--scope" ]; then local scope="$2"; shift 2; git commit -m "'$1'(${scope}): ${@}"; else git commit -m "'$1': ${@}"; fi }; a' fi } |