1
0
mirror of https://github.com/git/git.git synced 2024-09-28 10:00:54 +02:00

bash prompt: remove a redundant 'git diff' option

To get the dirty state indicator __git_ps1() runs 'git diff' with
'--quiet --exit-code' options.  '--quiet' already implies
'--exit-code', so the latter is unnecessary and can be removed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
SZEDER Gábor 2015-11-21 15:46:40 +01:00 committed by Jeff King
parent a30d11ebdf
commit 0af9f7ecb8

View File

@ -476,7 +476,7 @@ __git_ps1 ()
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
[ "$(git config --bool bash.showDirtyState)" != "false" ]
then
git diff --no-ext-diff --quiet --exit-code || w="*"
git diff --no-ext-diff --quiet || w="*"
if [ -n "$short_sha" ]; then
git diff-index --cached --quiet HEAD -- || i="+"
else