--- a/.bash_prompt Fri Jun 01 20:20:07 2012 +0900
+++ b/.bash_prompt Fri Jun 01 20:27:08 2012 +0900
if [[ "$GIT_TRACKED" ]] ; then
local GIT_STATUS=$(git status 2>/dev/null)
+ local GIT_BRANCH=$(grep '# On branch' <<< "$GIT_STATUS" | cut -d' ' -f4-)
- if [[ $(echo ${GIT_STATUS} | grep "# Your branch is behind") ]]; then
+ if [[ $(grep "# Your branch is behind" <<< "$GIT_STATUS") ]]; then
- if [[ $(echo ${GIT_STATUS} | grep "# Changes to be committed:") ]]; then
+ if [[ $(grep "# Changes to be committed:" <<< "$GIT_STATUS") ]]; then
- if [[ $(echo ${GIT_STATUS} | grep "# Changes not staged for commit:") ]]; then
+ if [[ $(grep "# Changes not staged for commit:" <<< "$GIT_STATUS") ]]; then
- local GIT_INFO=" ${G}±${GIT_STAGED}${GIT_UNSTAGED}${GIT_UPDATE}${RESET}"
+ local GIT_INFO=" ${G}${GIT_BRANCH}±${GIT_STAGED}${GIT_UNSTAGED}${GIT_UPDATE}${RESET}"