@matheusbsbs / matheus-bagliano / commits / ee6b71141f
Fork 0

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>

SZEDER Gábor committed May 29, 2009 at 14:00 UTC ee6b71141f2803bd4d4f6e1a17ef826567dc9644
1 file changed +4 -6
contrib/completion/git-completion.bash
+4 -6
@@ -150,12 +150,10 @@ __git_ps1 ()
150 fi
151 fi
152
153 - if [ -n "$b" ]; then
154 - if [ -n "${1-}" ]; then
155 - printf "$1" "$c${b##refs/heads/}$w$i$r"
156 - else
157 - printf " (%s)" "$c${b##refs/heads/}$w$i$r"
158 - fi
153 + if [ -n "${1-}" ]; then
154 + printf "$1" "$c${b##refs/heads/}$w$i$r"
155 + else
156 + printf " (%s)" "$c${b##refs/heads/}$w$i$r"
157 fi
158 fi
159 }