initialize utracked, unstaged and staged variables

The git prompt doesn' t work on debian 8 with bash 4.3.30(1)-release, awk 4.1.1
and git 2.1.4
pull/660/head
Frank Becker 2016-02-03 20:07:28 +01:00
parent 631e4605b9
commit 837f98fc9d
1 changed files with 5 additions and 1 deletions

View File

@ -94,6 +94,11 @@ function scm_prompt_info {
function git_status_summary {
awk '
BEGIN {
untracked = 0
unstaged = 0
staged = 0
}
{
if (!after_first && $0 ~ /^##.+/) {
print $0
@ -202,7 +207,6 @@ function git_prompt_vars {
SCM_PREFIX=${GIT_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX}
SCM_SUFFIX=${GIT_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX}
SCM_CHANGE=$(git rev-parse HEAD 2>/dev/null)
#RESET LANG
LANG=$LANG_BAK