b6c1de87b01aaf5eb434b86b1d32b92cb37467bb
- Author
- Carlo Sala <carlosalag@protonmail.com>
- Committer
- Carlo Sala <carlosalag@protonmail.com>
- Date
Message
fix(git-commit): add omz version check
Diff
1diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh
2index 7ad349735350f6bce6634f484e2a6f2604ab2f67..121ae59de6ca7195147205ddcbabb790af05e32f 100644
3--- a/plugins/git-commit/git-commit.plugin.zsh
4+++ b/plugins/git-commit/git-commit.plugin.zsh
5@@ -1,7 +1,8 @@
6-if git config --global --get-all alias.$_alias >/dev/null 2>&1 \
7- && ! git config --global --get-all oh-my-zsh.git-commit-alias >/dev/null 2>&1; then
8+local _rev="$(git -C $ZSH rev-parse HEAD 2> /dev/null)"
9+if [[ $_rev == $(git config --global --get oh-my-zsh.git-commit-alias 2> /dev/null) ]]; then
10 return
11 fi
12+git config --global oh-my-zsh.git-commit-alias "$_rev"
13
14 local -a _git_commit_aliases
15 _git_commit_aliases=(
16@@ -55,5 +56,3 @@ git commit -m "'$_type'${_scope:+(${_scope})}${_attention}:${_message}"
17
18 git config --global alias.$_alias "$_func"
19 done
20-
21-git config --global oh-my-zsh.git-commit-alias "true"