diff --git a/zsh/zshrc.d/20_aliases.sh b/zsh/zshrc.d/20_aliases.sh index e705fd8..c4919cc 100644 --- a/zsh/zshrc.d/20_aliases.sh +++ b/zsh/zshrc.d/20_aliases.sh @@ -281,7 +281,10 @@ clip() { } gb() { - while [[ ! -e ./.git ]] ; do - cd .. - done + _superproject="$(git rev-parse --show-superproject-working-tree)" + if [[ -n "${_superproject}" ]] ; then + builtin cd "${_superproject}" + else + builtin cd "$(git rev-parse --show-toplevel)" + fi }