提交 ad244d25 编写于 作者: T Ted Pavlic 提交者: Junio C Hamano

completion: Use consistent if [...] convention, not "test"

The local coding convention in bash completion is to use [...] rather
than test. Additionally,

    if [...]; then

is preferred over

    if [...]
    then

and so matching "if [...]\nthen" were changed accordingly.
Signed-off-by: NTed Pavlic <ted@tedpavlic.com>
Acked-by: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 fa26a401
...@@ -84,39 +84,30 @@ __git_ps1 () ...@@ -84,39 +84,30 @@ __git_ps1 ()
if [ -n "$g" ]; then if [ -n "$g" ]; then
local r local r
local b local b
if [ -d "$g/rebase-apply" ] if [ -d "$g/rebase-apply" ]; then
then if [ -f "$g/rebase-apply/rebasing" ]; then
if test -f "$g/rebase-apply/rebasing"
then
r="|REBASE" r="|REBASE"
elif test -f "$g/rebase-apply/applying" elif [ -f "$g/rebase-apply/applying" ]; then
then
r="|AM" r="|AM"
else else
r="|AM/REBASE" r="|AM/REBASE"
fi fi
b="$(git symbolic-ref HEAD 2>/dev/null)" b="$(git symbolic-ref HEAD 2>/dev/null)"
elif [ -f "$g/rebase-merge/interactive" ] elif [ -f "$g/rebase-merge/interactive" ]; then
then
r="|REBASE-i" r="|REBASE-i"
b="$(cat "$g/rebase-merge/head-name")" b="$(cat "$g/rebase-merge/head-name")"
elif [ -d "$g/rebase-merge" ] elif [ -d "$g/rebase-merge" ]; then
then
r="|REBASE-m" r="|REBASE-m"
b="$(cat "$g/rebase-merge/head-name")" b="$(cat "$g/rebase-merge/head-name")"
elif [ -f "$g/MERGE_HEAD" ] elif [ -f "$g/MERGE_HEAD" ]; then
then
r="|MERGING" r="|MERGING"
b="$(git symbolic-ref HEAD 2>/dev/null)" b="$(git symbolic-ref HEAD 2>/dev/null)"
else else
if [ -f "$g/BISECT_LOG" ] if [ -f "$g/BISECT_LOG" ]; then
then
r="|BISECTING" r="|BISECTING"
fi fi
if ! b="$(git symbolic-ref HEAD 2>/dev/null)" if ! b="$(git symbolic-ref HEAD 2>/dev/null)"; then
then if ! b="$(git describe --exact-match HEAD 2>/dev/null)"; then
if ! b="$(git describe --exact-match HEAD 2>/dev/null)"
then
b="$(cut -c1-7 "$g/HEAD")..." b="$(cut -c1-7 "$g/HEAD")..."
fi fi
fi fi
...@@ -125,8 +116,8 @@ __git_ps1 () ...@@ -125,8 +116,8 @@ __git_ps1 ()
local w local w
local i local i
if test -n "${GIT_PS1_SHOWDIRTYSTATE-}"; then if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
if test "$(git config --bool bash.showDirtyState)" != "false"; then if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
git diff --no-ext-diff --ignore-submodules \ git diff --no-ext-diff --ignore-submodules \
--quiet --exit-code || w="*" --quiet --exit-code || w="*"
if git rev-parse --quiet --verify HEAD >/dev/null; then if git rev-parse --quiet --verify HEAD >/dev/null; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册