use 'command git' in prompts

Fixes Zim issue with interation with any functions or aliases that wrap
'git'. See issue #30 for more information.
This commit is contained in:
Matt Hamilton 2016-02-04 15:08:22 -05:00
parent 9075729ac3
commit cb12222811
2 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,7 @@ prompt_context() {
prompt_git() { prompt_git() {
local color ref local color ref
is_dirty() { is_dirty() {
test -n "$(git status --porcelain --ignore-submodules)" test -n "$(command git status --porcelain --ignore-submodules)"
} }
ref=${vcs_info_msg_0_} ref=${vcs_info_msg_0_}
if [[ -n ${ref} ]]; then if [[ -n ${ref} ]]; then

View File

@ -41,12 +41,12 @@ minimal_path() {
} }
git_branch_name() { git_branch_name() {
local branch_name="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" local branch_name="$(command git rev-parse --abbrev-ref HEAD 2> /dev/null)"
[[ -n $branch_name ]] && print "$branch_name" [[ -n $branch_name ]] && print "$branch_name"
} }
git_repo_status(){ git_repo_status(){
local rs="$(git status --porcelain -b)" local rs="$(command git status --porcelain -b)"
if $(print "$rs" | grep -v '^##' &> /dev/null); then # is dirty if $(print "$rs" | grep -v '^##' &> /dev/null); then # is dirty
print "%F{red}" print "%F{red}"