Skip to content

Commit

Permalink
Add git status indicator
Browse files Browse the repository at this point in the history
Shows when there are uncommitted changes in a repository.
  • Loading branch information
PsychoLlama committed Mar 12, 2017
1 parent b037d08 commit 31ded01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions llama.zsh-theme
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
function llama_git_status {
local any_changes=$(git status --porcelain)

if [[ ! -z "$any_changes" ]]; then
echo "%{$fg[red]%}+"
fi
}

function llama_branch_name {
local branch=$(git_current_branch)
local prompt=""
Expand All @@ -10,6 +18,7 @@ function llama_branch_name {

# Prettify the branch name.
prompt+="%{$fg[yellow]%}["
prompt+=$(llama_git_status)
prompt+="%{$fg[cyan]%}$branch"
prompt+="%{$fg[yellow]%}]"

Expand Down

0 comments on commit 31ded01

Please sign in to comment.