work around for ndbroadbent/scm_breeze#27
This commit is contained in:
committed by
Nathan Broadbent
parent
9930ba5331
commit
240399bd92
@@ -166,8 +166,11 @@ function _git_index_count() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Returns the current git branch (returns nothing if not a git repository)
|
# Returns the current git branch (returns nothing if not a git repository)
|
||||||
parse_git_branch() {
|
function is_git_dirty {
|
||||||
\git branch 2> /dev/null | sed "s/^\* \([^ ]*\)/\1/;tm;d;:m"
|
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
|
||||||
|
}
|
||||||
|
function parse_git_branch {
|
||||||
|
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(is_git_dirty)]/"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user