Skip to content

Commit f7267d3

Browse files
author
Noah Gorny
committed
aliases: Do not allow mix of git-omz and git
1 parent cf38115 commit f7267d3

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

aliases/available/git-omz.aliases.bash

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# shellcheck shell=bash
22
cite 'about-alias'
3-
about-alias 'git aliases from oh-my-zsh'
3+
about-alias 'git aliases from oh-my-zsh (incompatible with regular git aliases option)'
44

5-
# We are not vendoring this, as we need to adapt it to bash :(
5+
if [[ -n $_bash_it_git_aliases_enabled ]]; then
6+
_log_error "git-omz aliases are incompatible with regular git aliases"
7+
return
8+
fi
69

710
# Load after regular git aliases
811
# BASH_IT_LOAD_PRIORITY: 160

aliases/available/git.aliases.bash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
cite 'about-alias'
33
about-alias 'common git abbreviations'
44

5+
# We can use this variable to make sure that we don't accidentally clash with git-zsh aliases
6+
_bash_it_git_aliases_enabled=true
7+
58
alias g='git'
69
alias get='git'
710

test/lib/search.bats

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ function local_teardown {
3939

4040
@test "search: git" {
4141
run _bash-it-search 'git' --no-color
42-
assert_line -n 0 ' aliases: git gitsvn '
42+
43+
assert_line -n 0 -p ' aliases:'
44+
for alias in 'git' 'gitsvn' 'git-omz'
45+
do
46+
echo $alias
47+
assert_line -n 0 -p $alias
48+
done
49+
4350
assert_line -n 1 -p ' plugins:'
4451
for plugin in "autojump" "git" "gitstatus" "git-subrepo" "jgitflow" "jump"
4552
do

0 commit comments

Comments
 (0)