fix #30 - untracked files are detected in bash

This commit is contained in:
Arialdo Martini 2015-01-02 23:43:20 +01:00
parent 6251191c5a
commit 7088266674

View File

@ -48,7 +48,7 @@ function build_prompt {
if [[ $git_status =~ ($'\n'|^)[MAD] && ! $git_status =~ ($'\n'|^).[MAD\?] ]]; then ready_to_commit=true; else ready_to_commit=false; fi if [[ $git_status =~ ($'\n'|^)[MAD] && ! $git_status =~ ($'\n'|^).[MAD\?] ]]; then ready_to_commit=true; else ready_to_commit=false; fi
number_of_untracked_files=`echo $git_status | grep -c "^??"` number_of_untracked_files=`echo "${git_status}" | grep -c "^??"`
if [[ $number_of_untracked_files -gt 0 ]]; then has_untracked_files=true; else has_untracked_files=false; fi if [[ $number_of_untracked_files -gt 0 ]]; then has_untracked_files=true; else has_untracked_files=false; fi
tag_at_current_commit=$(git describe --exact-match --tags $current_commit_hash 2> /dev/null) tag_at_current_commit=$(git describe --exact-match --tags $current_commit_hash 2> /dev/null)