Use $GIT_BINARY when original git binary is needed
This commit is contained in:
@@ -169,12 +169,12 @@ function _git_index_count() {
|
|||||||
echo $(sed -e "s/--.*//" "$GIT_REPO_DIR/.git_index" | \grep . | wc -l)
|
echo $(sed -e "s/--.*//" "$GIT_REPO_DIR/.git_index" | \grep . | wc -l)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Returns the current /usr/local/bin/git branch (returns nothing if not a git repository)
|
# Returns the current $GIT_BINARY branch (returns nothing if not a git repository)
|
||||||
function is_git_dirty {
|
function is_git_dirty {
|
||||||
[[ $(/usr/local/bin/git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
|
[[ $($GIT_BINARY status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
|
||||||
}
|
}
|
||||||
function parse_git_branch {
|
function parse_git_branch {
|
||||||
/usr/local/bin/git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
|
$GIT_BINARY branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
|
||||||
}
|
}
|
||||||
|
|
||||||
# If the working directory is clean, update the git repository. Otherwise, show changes.
|
# If the working directory is clean, update the git repository. Otherwise, show changes.
|
||||||
@@ -208,7 +208,7 @@ _git_index_update_all_branches() {
|
|||||||
local remotes merges branches
|
local remotes merges branches
|
||||||
# Get branch configuration from .git/config
|
# Get branch configuration from .git/config
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
for branch in $(/usr/local/bin/git branch 2> /dev/null | sed -e 's/.\{2\}\(.*\)/\1/'); do
|
for branch in $($GIT_BINARY branch 2> /dev/null | sed -e 's/.\{2\}\(.*\)/\1/'); do
|
||||||
# Skip '(no branch)'
|
# Skip '(no branch)'
|
||||||
if [[ "$branch" = "(no branch)" ]]; then continue; fi
|
if [[ "$branch" = "(no branch)" ]]; then continue; fi
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ disable_nullglob() { if [ $shell = "zsh" ]; then unsetopt NULL_GLOB; else shopt
|
|||||||
# Alias wrapper that ignores errors if alias is not defined.
|
# Alias wrapper that ignores errors if alias is not defined.
|
||||||
_alias(){ alias "$@" 2> /dev/null; }
|
_alias(){ alias "$@" 2> /dev/null; }
|
||||||
|
|
||||||
|
export GIT_BINARY=$(which git)
|
||||||
|
|
||||||
# Updates SCM Breeze from GitHub.
|
# Updates SCM Breeze from GitHub.
|
||||||
update_scm_breeze() {
|
update_scm_breeze() {
|
||||||
|
|||||||
Reference in New Issue
Block a user