mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
bash completion: add space between branch name and status flags
Improve the readability of the bash prompt by adding a space between the branch name and the status flags (dirty, stash, untracked). While we are cleaning up this section of code, the two cases for formatting the prompt are identical except for the format string, so make them the same. Suggested-by: Roman Fietze <roman.fietze@telemotive.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c18d5d82b4
commit
4cc47382df
@ -163,11 +163,8 @@ __git_ps1 ()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${1-}" ]; then
|
local f="$w$i$s$u"
|
||||||
printf "$1" "$c${b##refs/heads/}$w$i$s$u$r"
|
printf "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r"
|
||||||
else
|
|
||||||
printf " (%s)" "$c${b##refs/heads/}$w$i$s$u$r"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user