提交 ee6b7114 编写于 作者: S SZEDER Gábor 提交者: Junio C Hamano

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: NSZEDER Gábor <szeder@ira.uka.de>
Acked-by: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 c4d53592
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册