aliases: Do not allow mix of git-omz and git

pull/1831/head
Noah Gorny 2021-02-06 22:37:24 +02:00
parent cf38115809
commit f7267d3f9b
3 changed files with 16 additions and 3 deletions

View File

@ -1,8 +1,11 @@
# shellcheck shell=bash # shellcheck shell=bash
cite 'about-alias' cite 'about-alias'
about-alias 'git aliases from oh-my-zsh' about-alias 'git aliases from oh-my-zsh (incompatible with regular git aliases option)'
# We are not vendoring this, as we need to adapt it to bash :( if [[ -n $_bash_it_git_aliases_enabled ]]; then
_log_error "git-omz aliases are incompatible with regular git aliases"
return
fi
# Load after regular git aliases # Load after regular git aliases
# BASH_IT_LOAD_PRIORITY: 160 # BASH_IT_LOAD_PRIORITY: 160

View File

@ -2,6 +2,9 @@
cite 'about-alias' cite 'about-alias'
about-alias 'common git abbreviations' about-alias 'common git abbreviations'
# We can use this variable to make sure that we don't accidentally clash with git-zsh aliases
_bash_it_git_aliases_enabled=true
alias g='git' alias g='git'
alias get='git' alias get='git'

View File

@ -39,7 +39,14 @@ function local_teardown {
@test "search: git" { @test "search: git" {
run _bash-it-search 'git' --no-color run _bash-it-search 'git' --no-color
assert_line -n 0 ' aliases: git gitsvn '
assert_line -n 0 -p ' aliases:'
for alias in 'git' 'gitsvn' 'git-omz'
do
echo $alias
assert_line -n 0 -p $alias
done
assert_line -n 1 -p ' plugins:' assert_line -n 1 -p ' plugins:'
for plugin in "autojump" "git" "gitstatus" "git-subrepo" "jgitflow" "jump" for plugin in "autojump" "git" "gitstatus" "git-subrepo" "jgitflow" "jump"
do do