aboutsummaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2009-05-29 14:00:36 +0200
committerJunio C Hamano <gitster@pobox.com>2009-05-31 15:39:32 -0700
commitee6b71141f2803bd4d4f6e1a17ef826567dc9644 (patch)
treeb667d548e523201940cdc8c8d9028d6ffb5056a2 /contrib/completion
parentc4d5359230c4bd427f37662f9d12fdf006b6e6ba (diff)
downloadgit-ee6b71141f2803bd4d4f6e1a17ef826567dc9644.tar.gz
git-ee6b71141f2803bd4d4f6e1a17ef826567dc9644.tar.xz
bash: remove always true if statement from __git_ps1()
The recent commits 8763dbb1 (completion: fix PS1 display during a merge on detached HEAD, 2009-05-16), ff790b6a (completion: simplify "current branch" in __git_ps1(), 2009-05-10), and d7107ca6 (completion: fix PS1 display during an AM on detached HEAD, 2009-05-26) ensure that the branch name in __git_ps1() is always set to something sensible. Therefore, the condition for checking the non-empty branch name is always fulfilled, and can be removed. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash10
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c84d765ff..98b9cbedc 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -150,12 +150,10 @@ __git_ps1 ()
fi
fi
- if [ -n "$b" ]; then
- if [ -n "${1-}" ]; then
- printf "$1" "$c${b##refs/heads/}$w$i$r"
- else
- printf " (%s)" "$c${b##refs/heads/}$w$i$r"
- fi
+ if [ -n "${1-}" ]; then
+ printf "$1" "$c${b##refs/heads/}$w$i$r"
+ else
+ printf " (%s)" "$c${b##refs/heads/}$w$i$r"
fi
fi
}