Skip to content

Commit

Permalink
more tweaks to not call git-status twice
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanl committed Apr 8, 2009
1 parent 0ac7145 commit c31880d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 06_git
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [[ -x `which git` ]]; then
git rebase master
}
function git-need-to-push() {
if pushtime=$(git status | grep 'Your branch is ahead' 2> /dev/null); then
if pushtime=$(echo $1 | grep 'Your branch is ahead' 2> /dev/null); then
echo "↑ "
fi
}
Expand All @@ -25,7 +25,7 @@ if [[ -x `which git` ]]; then
dirty=$(echo $gstatus | sed 's/^#.*$//' | tail -2 | grep 'nothing to commit (working directory clean)'; echo $?)
if [[ x$branch != x ]]; then
dirty_color=$fg[green]
push_status=$(git-need-to-push)
push_status=$(git-need-to-push $gstatus 2> /dev/null)
if [[ $dirty = 1 ]] { dirty_color=$fg[red] }
[ x$branch != x ] && echo " %{$dirty_color%}$branch%{$reset_color%} $push_status"
fi
Expand Down

0 comments on commit c31880d

Please sign in to comment.