1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-18 10:22:00 +00:00

fix(git-commit): fix compatibility of alias functions (#11883)

This commit is contained in:
Haltarys 2023-09-10 09:28:33 +02:00 committed by GitHub
parent 079dbff2c4
commit b07c8cfe69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}