From 0887040c871983148db8e32bd836bcc5a7c2e18d Mon Sep 17 00:00:00 2001 From: sonnym Date: Tue, 10 Apr 2012 17:35:19 -0400 Subject: [PATCH] ignore subsequent lines of git status as they may break the equality check by including changes to the repository --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 915575246..b0d99bd2b 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -3,7 +3,7 @@ function git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) if [ -z $ref ]; then # check if in detached HEAD mode - branch_name=$(git status -sb $(git_submodule_syntax) 2> /dev/null) + branch_name=$(git status -sb $(git_submodule_syntax) 2> /dev/null | head -n 1) if [ "$branch_name" = "## HEAD (no branch)" ]; then # set tag name if found tag_name=$(git name-rev --name-only $(git --no-pager show --stat 2> /dev/null | head -n 1 | awk '{ print $2 }') 2> /dev/null)